{"openapi":"3.0.3","info":{"title":"Davix H2I API","description":"Image, PDF, document, data, AI and HTML-rendering processing API. Every endpoint listed as job_eligible in GET /v1/registry additionally accepts an opt-in `async: true` field (JSON body or multipart field, string \"true\" or boolean) -- omitted or false, the endpoint behaves exactly as documented below (a synchronous 200); with it set, and an individual customer API key, the endpoint instead responds 202 with {job_id, status_url}, and the same result becomes available via GET /v1/jobs/{id} once finished.","version":"3.0.0","x-contract-version":"3.0.0","x-contract-hash":"60a479b3e4d3fbeae05ddd20318b7c7b6ada6e09a44afab87e4fae5661b21404"},"servers":[{"url":"/","description":"This Davix H2I installation"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"An API key sent in the X-Api-Key header."},"BearerAuth":{"type":"http","scheme":"bearer","description":"The same API key sent as `Authorization: Bearer <key>`."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional. Reusing the same key for a materially different request (different file/parameter set) is rejected with 409 idempotency_key_conflict; reusing it for an identical retry safely avoids double-billing. Honoured by quota-metered processing endpoints (see endpoint.idempotency.supported)."}},"schemas":{"Error":{"type":"object","properties":{"status":{"type":"string","example":"error"},"code":{"type":"string","example":"invalid_parameter"},"message":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"details":{"type":"object","additionalProperties":true},"renewal_url":{"type":"string","description":"The plan page, on errors that renewing or upgrading solves."},"help":{"type":"object","description":"The error in plain language, for showing to a person.","properties":{"title":{"type":"string","description":"What happened, in a few words."},"explanation":{"type":"string","description":"Why it happened."},"steps":{"type":"array","items":{"type":"string"},"description":"What to do, step by step."},"links":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["upgrade","renew","usage","keys","jobs","signin","docs","support"]},"label":{"type":"string"},"url":{"type":"string"}}}}}},"support":{"type":"object","description":"How to reach support, on errors where support can help.","properties":{"email":{"type":"string"},"url":{"type":"string"},"website":{"type":"string"}}}}},"request_id":{"type":"string","format":"uuid"}}},"AiCatalogStatus":{"type":"object","properties":{"count":{"type":"integer"},"source":{"type":"string"},"fetched_at":{"type":"string","format":"date-time","nullable":true},"age_seconds":{"type":"integer","nullable":true},"fresh":{"type":"boolean"},"stale_beyond_max":{"type":"boolean"},"last_error":{"type":"string","nullable":true},"last_error_at":{"type":"string","format":"date-time","nullable":true},"skipped_entries":{"type":"integer"},"refreshing":{"type":"boolean"}},"required":["count","source","fresh","stale_beyond_max","skipped_entries","refreshing"]},"AiEnvelope":{"type":"object","description":"The Davix H2I AI response envelope. `result` holds the feature-specific data (see the linked capability for its shape); provider-specific raw responses are never exposed.","properties":{"result":{"description":"Feature-specific result. For image features this is {images:[{url,width,height,format,size_bytes}], model_notes}."},"evidence":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"quote":{"type":"string"},"page":{"type":"integer","nullable":true},"document":{"type":"integer","nullable":true},"verified":{"type":"string","enum":["verified","page_corrected","unverified","unverifiable"]}}}},"model":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"provider":{"type":"string"},"selected_by":{"type":"string","enum":["auto","explicit"]},"fallback_used":{"type":"boolean"},"output_repaired":{"type":"boolean"},"attempts":{"type":"integer"}}},"warnings":{"type":"array","items":{"type":"string"}},"quality":{"type":"object","properties":{"readiness":{"type":"string","enum":["production-ready","experimental","unbenchmarked","feature-unavailable"]},"selection_basis":{"type":"string","nullable":true},"grounding":{"type":"object","nullable":true},"sources":{"type":"object","nullable":true},"notes":{"type":"array","items":{"type":"string"}}}},"usage":{"type":"object","nullable":true,"properties":{"prompt_tokens":{"type":"integer","nullable":true},"completion_tokens":{"type":"integer","nullable":true},"total_tokens":{"type":"integer","nullable":true,"description":"The provider's own reported total, not a client-side sum."}}}}},"AiFeatureDetail":{"allOf":[{"$ref":"#/components/schemas/AiFeatureSummary"}],"type":"object","properties":{"summary":{"type":"string"},"requirements":{"type":"object","properties":{"structured":{"type":"string"},"output":{"type":"string"},"vision":{"type":"string"}},"required":["structured","output","vision"]},"deterministic_stages":{"type":"array","items":{"type":"string"}},"input":{"type":"object","properties":{"files":{"type":"string"},"min_files":{"type":"integer"},"max_files":{"type":"integer"}},"required":["files","min_files","max_files"]},"eligible_model_count":{"type":"integer"},"benchmark_samples":{"type":"integer"},"prompt":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"integer"}},"required":["id","version"]}},"required":["summary","requirements","deterministic_stages","input","eligible_model_count","benchmark_samples","prompt"]},"AiFeatureSummary":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"endpoint":{"type":"string"},"method":{"type":"string"},"features":{"type":"array","items":{"type":"integer"}},"classification":{"type":"string"},"readiness":{"type":"string","enum":["production-ready","experimental","unbenchmarked","feature-unavailable"]},"readiness_source":{"type":"string"},"unavailable_reason":{"type":"string","nullable":true},"alternatives":{"type":"array","items":{"type":"string"}}},"required":["id","title","endpoint","method","features","classification","readiness","readiness_source","alternatives"]},"AiModel":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"description":{"type":"string","nullable":true},"context_length":{"type":"integer","nullable":true},"max_output_tokens":{"type":"integer","nullable":true},"modalities":{"type":"object","properties":{"input":{"type":"array","items":{"type":"string"}},"output":{"type":"array","items":{"type":"string"}}},"required":["input","output"]},"capabilities":{"type":"object","properties":{"text":{"type":"boolean"},"imageInput":{"type":"boolean"},"fileInput":{"type":"boolean"},"videoInput":{"type":"boolean"},"audioInput":{"type":"boolean"},"imageOutput":{"type":"boolean"},"audioOutput":{"type":"boolean"},"structuredOutputs":{"type":"boolean"},"responseFormat":{"type":"boolean"},"tools":{"type":"boolean"},"reasoning":{"type":"boolean"},"temperature":{"type":"boolean"},"topP":{"type":"boolean"},"seed":{"type":"boolean"}},"required":["text","imageInput","fileInput","videoInput","audioInput","imageOutput","audioOutput","structuredOutputs","responseFormat","tools","reasoning","temperature","topP","seed"]},"max_tokens_parameter":{"type":"string","nullable":true},"supported_parameters":{"type":"array","items":{"type":"string"}},"pricing":{"type":"object","properties":{"prompt":{"type":"number","nullable":true},"completion":{"type":"number","nullable":true},"image":{"type":"number","nullable":true},"imageOutput":{"type":"number","nullable":true},"request":{"type":"number","nullable":true},"webSearch":{"type":"number","nullable":true}},"description":"Per-unit prices as reported by the provider; null when not priced."},"moderated":{"type":"boolean"},"expires_at":{"type":"string","format":"date-time","nullable":true},"knowledge_cutoff":{"type":"string","nullable":true},"benchmarked_tasks":{"type":"integer"}},"required":["id","name","provider","supported_parameters","moderated","benchmarked_tasks"]},"AsyncJobAccepted":{"type":"object","properties":{"job_id":{"type":"integer"},"status_url":{"type":"string"},"status":{"type":"string"},"request_id":{"type":"string"}},"required":["job_id","status_url"],"description":"Returned with HTTP 202 when `async: true` was sent. Poll GET /v1/jobs/{id} (status_url)."},"BackgroundRemovalResult":{"allOf":[{"$ref":"#/components/schemas/ImageResult"}],"type":"object","properties":{"background":{"type":"array","items":{"type":"integer"}},"removedRatio":{"type":"number"}},"required":["background","removedRatio"]},"CategoryUsage":{"type":"object","properties":{"calls":{"type":"integer"},"files":{"type":"integer"},"limit":{"type":"integer","nullable":true},"units":{"type":"integer","nullable":true,"description":"Used in the plan's unit."}},"required":["calls","files"]},"Certificate":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"subject":{"type":"string","nullable":true},"issuer":{"type":"string","nullable":true},"fingerprint_sha256":{"type":"string"},"valid_from":{"type":"string","format":"date-time","nullable":true},"valid_to":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"},"last_used_at":{"type":"string","format":"date-time","nullable":true}},"required":["id","name","fingerprint_sha256","created_at"]},"ContractEndpoint":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string"},"audience":{"type":"string"},"auth":{"type":"string"},"request":{"type":"object","properties":{"contentType":{"type":"string","nullable":true},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ContractField"}}},"required":["fields"]},"response":{"type":"object","properties":{"contentType":{"type":"string"},"statuses":{"type":"array","items":{"type":"integer"}},"description":{"type":"string","nullable":true},"schema":{"type":"object"},"kind":{"type":"string"}},"required":["contentType","statuses"]},"errorStatuses":{"type":"array","items":{"type":"integer"}},"errors":{"type":"array","items":{"type":"string"}},"idempotency":{"type":"object"},"actions":{"type":"object"},"platform":{"type":"object"},"deprecated":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"notes":{"type":"string"},"sdk":{"type":"object","properties":{"namespace":{"type":"array","items":{"type":"string"}},"method":{"type":"string"}},"required":["namespace","method"]}},"required":["id","method","path","name","category","audience","auth","request","response","errorStatuses","platform","sdk"],"additionalProperties":true},"ContractEndpointSummary":{"type":"object","properties":{"id":{"type":"string"},"sdk":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"path":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"audience":{"type":"string","enum":["public","customer"]},"auth":{"type":"string","enum":["none","apiKey"]},"contentType":{"type":"string","nullable":true},"async":{"type":"boolean"},"idempotent":{"type":"boolean"},"upload":{"type":"boolean"},"fieldCount":{"type":"integer"},"tags":{"type":"array","items":{"type":"string"}},"deprecated":{"type":"boolean"}},"required":["id","sdk","method","path","name","category","audience","auth","async","idempotent","upload","fieldCount","deprecated"]},"ContractEnum":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{}},"description":{"type":"string","nullable":true}},"required":["name","values"],"additionalProperties":true},"ContractErrorDef":{"type":"object","properties":{"code":{"type":"string"},"statuses":{"type":"array","items":{"type":"integer"}},"message":{"type":"string"},"description":{"type":"string"},"retryable":{"type":"boolean"},"family":{"type":"string"},"extra":{"type":"array","items":{"type":"string"}}},"required":["code","statuses","retryable","family"],"additionalProperties":true},"ContractField":{"type":"object","properties":{"name":{"type":"string"},"location":{"type":"string","enum":["path","query","header","form","json"]},"type":{"type":"string","enum":["string","integer","number","boolean","file","array","object"]},"required":{"type":"boolean"},"description":{"type":"string"},"nullable":{"type":"boolean"},"default":{},"enum":{"type":"array","items":{}},"minimum":{"type":"number"},"maximum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minLength":{"type":"integer"},"maxLength":{"type":"integer"},"pattern":{"type":"string"},"format":{"type":"string"},"behavior":{"type":"object"},"file":{"type":"object"},"aliases":{"type":"array","items":{"type":"string"}},"enumName":{"type":"string"}},"required":["name","location","type","required"],"additionalProperties":true},"EndpointAccess":{"type":"object","properties":{"render":{"type":"boolean"},"image":{"type":"boolean"},"pdf":{"type":"boolean"},"data":{"type":"boolean"},"documents":{"type":"boolean"}},"required":["render","image","pdf","data","documents"],"description":"Effective per-category access of the plan."},"EndpointLimits":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true,"description":"The endpoint's name."},"operation":{"type":"string","enum":["render","image","pdf","data","documents","ai"],"nullable":true,"description":"The operation of your plan this endpoint belongs to (the plan switches, allows and counts by operation)."},"method":{"type":"string"},"path":{"type":"string"},"allowed":{"type":"boolean","description":"false when the plan does not allow this endpoint."},"min_plan":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"tier":{"type":"integer"}},"required":["slug","name","tier"],"nullable":true,"description":"Customer keys: the smallest plan that includes this endpoint (null when no plan includes it yet)."},"unlock":{"type":"object","additionalProperties":true,"nullable":true,"description":"Customer keys, only when allowed is false: what unlocks this endpoint. state is plan (the plan that includes it is in plan) or soon (no plan includes it yet)."},"timeout_seconds":{"type":"integer","nullable":true,"description":"null = no timeout."},"files":{"type":"object","properties":{"per_request":{"type":"integer","nullable":true,"description":"Most files in one request."},"total_mb_per_request":{"type":"number","nullable":true,"description":"Most megabytes in one request."},"max_file_size_bytes":{"type":"integer","nullable":true,"description":"Largest single file."},"max_input_dimension_px":{"type":"integer","nullable":true,"description":"Longest side of an uploaded image (image endpoints, when capped)."},"multiple_uploads":{"type":"boolean","description":"false = one file per request."},"count_basis":{"type":"string","enum":["each_file","whole_upload"],"description":"How a multi-file upload counts against the plan."}},"required":["multiple_uploads","count_basis"],"nullable":true,"description":"Only for endpoints that take files. null values mean no limit."},"output":{"type":"object","properties":{"max_dimension_px":{"type":"integer","nullable":true,"description":"Longest side of a result, in pixels."},"max_pixels":{"type":"integer","nullable":true,"description":"Width x height of a result."},"max_dpi":{"type":"integer","nullable":true,"description":"Highest PDF render resolution (PDF to images)."}},"nullable":true,"description":"Only for endpoints whose result size you choose. null values mean no limit."},"render":{"type":"object","properties":{"max_html_chars":{"type":"integer","nullable":true},"max_width_px":{"type":"integer","nullable":true},"max_height_px":{"type":"integer","nullable":true},"max_pixels":{"type":"integer","nullable":true}},"nullable":true,"description":"Only for the HTML render endpoints."},"pages":{"type":"object","properties":{"max_pages":{"type":"integer","nullable":true},"to_images":{"type":"integer","nullable":true},"extract_images":{"type":"integer","nullable":true},"split":{"type":"integer","nullable":true}},"nullable":true,"description":"Only for the endpoints with a PDF page cap. `max_pages` is the cap that applies to this endpoint; the named ones are the same value under the control's own name."},"cost_per_call":{"type":"number","nullable":true,"description":"Customer keys: how many units of the plan's allowance one call (one file on a files plan, one request on a requests plan) uses on this endpoint. 1 unless the plan says otherwise."},"counts":{"type":"object","properties":{"basis":{"type":"string"},"per":{"type":"integer"}},"required":["basis","per"],"nullable":true,"description":"Customer keys: what this tool counts on your plan. basis is ai_budget (the tool is paid from your plan's AI budget, not in credits), files (each file counts) or pages (the pages of all documents are added up and divided by per, rounded up). cost_per_call is the price of one counted file."},"monthly_cap":{"type":"integer","nullable":true,"description":"Customer keys: the endpoint's own limit per plan period, counted inside the plan's allowance. Absent when the plan sets none."},"job_start_rate":{"type":"object","properties":{"limit":{"type":"integer"},"per_seconds":{"type":"integer","nullable":true}},"required":["limit"],"nullable":true,"description":"Customer keys: how many background jobs you may start per window."},"items":{"type":"array","items":{"type":"object"},"nullable":true,"description":"Customer keys: every control your plan has for this endpoint, ready to show as it is. Each item has key, label, group, kind, unit, value (null = no limit), text (the value as a person reads it), chip (a short form, or null), set (true when your plan itself sets it), limited, platform_default and, for a limit that accumulates over a window (request rate, data volume, AI budget, job starts), used. The list follows what the plan editor offers for the endpoint, so a new kind of limit appears here without any change to a client."},"formats":{"type":"object","additionalProperties":true,"nullable":true,"description":"Only for endpoints that take or produce a format your plan can switch on or off: one boolean per format group (raster_extended, layered_raw, postscript, legacy_office, email, data_extended, markup_text), false = your plan does not include it (the request is refused with 403 format_not_allowed)."},"features":{"type":"object","properties":{"allow_url_ingestion":{"type":"boolean","nullable":true,"description":"false = source_url / url inputs are not allowed."},"url_download_max_bytes":{"type":"integer","nullable":true,"description":"Largest file fetched from a URL."},"ocr_max_pages":{"type":"integer","nullable":true,"description":"Most pages one OCR request reads."},"ocr_max_languages":{"type":"integer","nullable":true,"description":"Most OCR languages in one request."},"allow_ocr_extended_languages":{"type":"boolean","nullable":true,"description":"false = only the standard OCR languages."},"allow_async_jobs":{"type":"boolean","nullable":true,"description":"false = async=true (a background job) is refused on this endpoint with 403 async_not_allowed."},"max_active_jobs":{"type":"integer","nullable":true,"description":"Most jobs you may have queued or running at once (all endpoints together); more are refused with 429 async_limit_reached."},"job_queue_wait_seconds":{"type":"integer","nullable":true,"description":"How long a job of yours may wait for a free processing slot before it fails as busy."},"records_per_request":{"type":"integer","nullable":true,"description":"Most records in one request (the plan control itself; see `records`)."},"records_per_unit":{"type":"integer","nullable":true,"description":"Records that count as one unit (the plan control itself; see `records`)."}},"nullable":true,"description":"Only for endpoints with plan-controlled features. null = no limit."},"records":{"type":"object","properties":{"max_per_request":{"type":"integer","description":"The most records one request may carry (0 = records are not allowed on your plan)."},"count_basis":{"type":"string","enum":["each_record","every_n","whole_request"],"description":"How records count toward your quota: each record, every N records (records_per_unit), or the whole request as one unit."},"records_per_unit":{"type":"integer","description":"1 = each record counts; N = every N records count as one unit; 0 = the whole request counts as one."}},"required":["max_per_request","count_basis","records_per_unit"],"nullable":true,"description":"Only for endpoints that take `records` (one document per record)."}},"required":["id","method","path","allowed"]},"FaviconFile":{"allOf":[{"$ref":"#/components/schemas/ImageResult"}],"type":"object","properties":{"name":{"type":"string"},"purpose":{"type":"string"},"sizes":{"type":"array","items":{"type":"integer"}}},"required":["name","purpose"]},"FormatInfo":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"family":{"type":"string","enum":["image","document","data"]},"group":{"type":"string"},"status":{"type":"string","enum":["supported","planned"]},"mime_types":{"type":"array","items":{"type":"string"}},"extensions":{"type":"array","items":{"type":"string"}},"capabilities":{"type":"object","additionalProperties":true,"description":"can_read / can_write and, where true, animated, alpha, lossy, vector, multipage."},"available":{"type":"boolean","description":"Supported and the tool behind it is installed on this server."},"allowed":{"type":"boolean","description":"The calling key's plan allows it on at least one endpoint that handles it (always true for shared keys and core formats)."},"accepted_by":{"type":"array","items":{"type":"object","properties":{"endpoint":{"type":"string"},"field":{"type":"string"},"allowed":{"type":"boolean"}},"required":["endpoint","field","allowed"]}},"produced_by":{"type":"array","items":{"type":"object","properties":{"endpoint":{"type":"string"},"field":{"type":"string"},"allowed":{"type":"boolean"}},"required":["endpoint","field","allowed"]}}},"required":["id","label","family","group","status","mime_types","extensions","capabilities","available","allowed","accepted_by","produced_by"],"description":"One file format."},"ImageComparison":{"type":"object","properties":{"width":{"type":"integer"},"height":{"type":"integer"},"resized":{"type":"boolean"},"region":{"type":"object","additionalProperties":true,"nullable":true},"metrics":{"type":"array","items":{"type":"string"}},"identical":{"type":"boolean"},"match":{"type":"boolean"},"maxDiffRatio":{"type":"number"},"pixel":{"type":"object","additionalProperties":true,"description":"diffPixels, totalPixels, diffRatio, similarity, threshold."},"grid":{"type":"object","additionalProperties":true,"description":"cols, rows and one entry per cell: row, col, x, y, width, height, diffPixels, diffRatio."},"ssim":{"type":"number"},"psnr":{"type":"number","nullable":true},"mse":{"type":"number"},"psnrInfinite":{"type":"boolean"},"hash":{"type":"object","additionalProperties":true,"description":"algorithm, the two hashes, Hamming distance (0-64) and similarity."}},"required":["width","height","resized","metrics","identical","match","maxDiffRatio"],"additionalProperties":true,"description":"The measurements. Which keys appear depends on `metrics`."},"ImageResult":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string","nullable":true},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"page":{"type":"integer","description":"For a multi-page source converted page by page: the page this file is (counting from 1)."},"pages":{"type":"integer","description":"Number of frames in the file when it is animated."}},"required":["url","format","sizeBytes","width","height"]},"InspectEntry":{"type":"object","properties":{"originalName":{"type":"string","nullable":true},"checks":{"type":"object","description":"One entry per requested check (colors, palette, hash, transparency, quality, efficiency, dimensions, aspectratio, format, animation, ...). The sub-structure depends on the check."}},"required":["checks"]},"Job":{"type":"object","properties":{"id":{"type":"integer"},"job_type":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed","cancelled"]},"progress_percent":{"type":"integer"},"result":{"type":"object","nullable":true,"description":"The synchronous response body of the job (set once completed); each results[] entry carries a `domain` field (image, pdf or render)."},"error_message":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":"string","format":"date-time","nullable":true},"completed_at":{"type":"string","format":"date-time","nullable":true},"status_url":{"type":"string"}},"required":["id","job_type","status","progress_percent","created_at","status_url"]},"Key":{"type":"object","properties":{"id":{"type":"integer"},"key_prefix":{"type":"string"},"key_last4":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"status":{"type":"string","description":"active, expired, disabled (revoked)."},"plan_slug":{"type":"string","nullable":true},"plan_name":{"type":"string","nullable":true},"valid_from":{"type":"string","format":"date-time","nullable":true},"valid_until":{"type":"string","format":"date-time","nullable":true},"rotated_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expired":{"type":"boolean","description":"true once the key stopped working because its own expiry (or the plan window it follows) passed. It stays listed until deleted."},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"The expiry the customer chose for this key, if any."},"quota_limit":{"type":"integer","nullable":true,"description":"The most units this key may use (in the plan's unit), if the customer set one."},"usage":{"type":"object","properties":{"used":{"type":"integer"},"unit":{"type":"string"}},"required":["used","unit"],"nullable":true,"description":"In GET /v1/keys: used (units this key used of the shared quota in the current period) and unit."},"ai_limit":{"type":"number","nullable":true,"description":"The most of your plan's AI this key may use, as a percentage from 1 to 100, if you set one. Only on a plan whose AI has a budget of its own."},"ai_limit_unit":{"type":"string","nullable":true,"description":"percent: what ai_limit counts."},"ai_usage":{"type":"object","properties":{"used":{"type":"number"},"unit":{"type":"string"}},"required":["used","unit"],"nullable":true,"description":"In GET /v1/keys, on a plan whose AI has a budget of its own: used (how much of the key's AI limit, or of the plan's AI, this key used in the current period, in percent), unit (percent), under_one (some, but less than 1%) and of (key_limit or plan)."}},"required":["id","key_prefix","status","created_at","updated_at","expired"]},"LayoutCell":{"type":"object","properties":{"index":{"type":"integer"},"x":{"type":"integer"},"y":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"}},"required":["index","x","y","width","height"]},"LayoutResult":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["png"]},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"cols":{"type":"integer"},"rows":{"type":"integer"},"cells":{"type":"array","items":{"$ref":"#/components/schemas/LayoutCell"}},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."}},"required":["url","format","sizeBytes","width","height","cols","rows","cells"]},"MetadataEditResult":{"allOf":[{"$ref":"#/components/schemas/ImageResult"}],"type":"object","properties":{"report":{"$ref":"#/components/schemas/MetadataReport"}}},"MetadataReport":{"type":"object","properties":{"before":{"type":"integer"},"after":{"type":"integer"},"removed":{"type":"integer"},"removedTags":{"type":"array","items":{"type":"string"}},"kept":{"type":"integer"},"keptTags":{"type":"array","items":{"type":"string"}},"identifyingLeft":{"type":"integer"},"identifyingTags":{"type":"array","items":{"type":"object"}},"risks":{"type":"object","additionalProperties":true},"warnings":{"type":"array","items":{"type":"string"}},"note":{"type":"string","nullable":true}},"required":["before","after","removed","removedTags","kept","keptTags","identifyingLeft","identifyingTags","warnings"],"additionalProperties":true,"description":"What a change did: counts before and after, what was removed, what was kept on purpose and what identifying is left."},"MetadataTag":{"type":"object","properties":{"key":{"type":"string"},"group":{"type":"string"},"category":{"type":"string","nullable":true},"name":{"type":"string"},"value":{},"readOnly":{"type":"boolean"},"structural":{"type":"boolean","nullable":true},"risks":{"type":"array","items":{"type":"string"},"nullable":true}},"required":["key","group","name","readOnly"],"additionalProperties":true,"description":"One tag of the file."},"Notification":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string"},"title":{"type":"string"},"message":{"type":"string","nullable":true},"action_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"read_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","type","title","created_at"]},"Preset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"endpoint":{"type":"string"},"parameters":{"type":"object","description":"The saved parameter values, keyed by the endpoint's own field names."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","endpoint","parameters","createdAt","updatedAt"]},"StoredFile":{"type":"object","properties":{"id":{"type":"integer"},"original_filename":{"type":"string","nullable":true},"mime_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["file","text"],"description":"file = an image, PDF or other file the operation made; text = the text (JSON) an operation answered with, kept like a file."},"category":{"type":"string"},"size_bytes":{"type":"integer"},"operation":{"type":"string","nullable":true},"job_id":{"type":"integer","nullable":true},"status":{"type":"string"},"url":{"type":"string","format":"uri","nullable":true,"description":"Signed download URL; null unless status is \"available\"."},"expires_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"},"request_id":{"type":"string","nullable":true},"parameters":{"type":"object","nullable":true,"description":"The parameters the request used (secrets and bulky content such as HTML are left out). Null for files recorded before this was kept."},"input_names":{"type":"array","items":{"type":"string"},"description":"File names of the uploads that were processed."},"settings":{"type":"array","items":{"$ref":"#/components/schemas/StoredSetting"},"description":"Every setting of the operation that has a value for this file: the ones the request set (source set) and the ones it left alone that have a default (source default). Empty for files recorded before the request details were kept."},"api_key_label":{"type":"string","nullable":true},"charge":{"type":"object","additionalProperties":true,"nullable":true,"description":"GET /v1/files/{id} only, when it was recorded: how the credits of the request that made this file were worked out (credits, counted, basis files or pages, per, cost_per_call, files, pages, and extra when extra credits paid)."},"app":{"type":"string","nullable":true,"description":"The app that made the file: the name sent in the `app` field or `X-Davix-App` header, or an official client recognised from its User-Agent (for example \"Davix H2I plugin\"). Null when it is not known."},"duration_ms":{"type":"integer","nullable":true}},"required":["id","kind","category","size_bytes","status","created_at","input_names","settings"]},"StoredSetting":{"type":"object","properties":{"name":{"type":"string"},"value":{},"source":{"type":"string","enum":["set","default"]}},"required":["name","source"]},"Template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"kind":{"type":"string"},"html":{"type":"string","nullable":true,"description":"The document (HTML templates, not in the list)."},"css":{"type":"string","nullable":true,"description":"The CSS (HTML templates, not in the list)."},"fileFormat":{"type":"string","nullable":true,"description":"docx or odt (DOCX / ODT templates)."},"variables":{"type":"array","items":{"$ref":"#/components/schemas/TemplateVariable"}},"sizeBytes":{"type":"integer"},"lastUsedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/TemplateWarning"},"nullable":true,"description":"Placeholders written like {{...}} that are not valid variable names (they are not replaced)."}},"required":["id","name","description","kind","variables","sizeBytes","createdAt","updatedAt"]},"TemplateVariable":{"type":"object","properties":{"name":{"type":"string"},"default":{"type":"string","nullable":true},"required":{"type":"boolean"},"description":{"type":"string"}},"required":["name","required","description"]},"TemplateWarning":{"type":"object","properties":{"placeholder":{"type":"string"},"message":{"type":"string"}},"required":["placeholder","message"]},"UsageSummary":{"type":"object","properties":{"period":{"type":"string"},"used_files":{"type":"integer"},"monthly_quota":{"type":"integer","nullable":true},"remaining":{"type":"integer","nullable":true},"percent_used":{"type":"integer","nullable":true},"by_category":{"type":"object","properties":{"render":{"$ref":"#/components/schemas/CategoryUsage"},"image":{"$ref":"#/components/schemas/CategoryUsage"},"pdf":{"$ref":"#/components/schemas/CategoryUsage"},"ai":{"$ref":"#/components/schemas/CategoryUsage"},"data":{"$ref":"#/components/schemas/CategoryUsage"},"documents":{"$ref":"#/components/schemas/CategoryUsage"}},"required":["render","image","pdf","ai","data","documents"]},"bytes_in":{"type":"integer"},"bytes_out":{"type":"integer"},"errors":{"type":"integer"},"last_request_at":{"type":"string","format":"date-time","nullable":true},"unit":{"type":"string","description":"What the quota counts: 'files' (files processed) or 'requests' (requests made), as the plan says."},"period_start":{"type":"string","format":"date-time","nullable":true,"description":"When the current quota period began (the plan period)."},"period_end":{"type":"string","format":"date-time","nullable":true,"description":"When it ends and the shared quota starts again."}},"required":["period","used_files","bytes_in","bytes_out","errors","unit"]},"ValidationResult":{"type":"object","properties":{"validated":{"type":"boolean"},"valid":{"type":"boolean","description":"true when the real request would be accepted."},"endpoint":{"type":"string"},"errors":{"type":"array","items":{"type":"object"},"description":"Every problem found: field, code (invalid_parameter or missing_field), message, and where known value / minimum / maximum / allowed / limit / limit_name."},"files":{"type":"object","properties":{"received":{"type":"integer"},"bytes":{"type":"integer"},"processed_separately":{"type":"boolean","description":"true when several files would each be processed on their own (one result per file)."}},"required":["received","bytes","processed_separately"]},"estimate":{"type":"object","properties":{"requests":{"type":"integer"},"files":{"type":"integer"},"credits":{"type":"number","nullable":true,"description":"Credit plans, when the request passes the check: the credits it would be charged."},"counted":{"type":"number","nullable":true,"description":"How many counted files that is."},"basis":{"type":"string","nullable":true},"per":{"type":"integer","nullable":true},"cost_per_call":{"type":"number","nullable":true},"pages":{"type":"integer","nullable":true,"description":"Only for a tool that counts pages: the pages of all the documents sent."}},"required":["requests","files"],"description":"What the real request would count against the plan."},"limits":{"allOf":[{"$ref":"#/components/schemas/EndpointLimits"}],"nullable":true,"description":"The limits that apply to this endpoint for your key (same as GET /v1/limits)."}},"required":["validated","valid","endpoint","errors","files","estimate"]}}},"tags":[{"name":"Images","description":"Image processing endpoints"},{"name":"PDFs","description":"PDF processing endpoints"},{"name":"Render","description":"HTML rendering endpoints"},{"name":"Data","description":"Structured-data format conversion"},{"name":"Documents","description":"Document format conversion: PDF <-> Office/ODF/RTF/EPUB, HTML/TXT/Markdown -> DOCX"},{"name":"Presets","description":"Reusable variant-preset CRUD"},{"name":"Templates","description":"Saved content with {{variables}} (HTML, DOCX) to render with templateId"},{"name":"Notifications","description":"In-app notifications (individual customer keys)"},{"name":"Jobs","description":"Async job tracking"},{"name":"Files","description":"Processed-file history"},{"name":"Keys","description":"Self-service API key management (individual customer keys)"},{"name":"Subscriptions","description":"Own subscription / plan snapshot"},{"name":"Usage","description":"Own usage"},{"name":"Limits","description":"The limits that apply to your key right now (per plan and endpoint, changeable at any time)"},{"name":"Account","description":"Own account profile"},{"name":"Meta","description":"API metadata (key verification, OpenAPI, contract, capabilities)"},{"name":"AI","description":"Davix H2I AI Platform -- document intelligence, OCR, image intelligence/generation/enhancement and content generation."},{"name":"Certificates","description":"Signing certificates stored for POST /v1/pdfs/sign (individual customer keys)"}],"paths":{"/openapi.json":{"get":{"operationId":"openapi.json","summary":"This OpenAPI specification","description":"This OpenAPI specification","tags":["Meta"],"security":[],"responses":{"200":{"description":"The OpenAPI document.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"The OpenAPI 3.0 document describing this API (generated from the contract)."}}}}},"x-davix-h2i-id":"openapi.json","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/openapi.json\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.openapi();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->openapi();\necho $result->requestId;"}]}},"/openapi/categories/{name}.json":{"get":{"operationId":"openapi.categories._name_","summary":"OpenAPI: one category","description":"A valid, smaller OpenAPI 3 document with only the operations of one category.","tags":["Meta"],"security":[],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9 _-]{1,40}$"},"description":"A category name, e.g. Images."}],"responses":{"200":{"description":"A valid, smaller OpenAPI 3 document with only the operations of one category.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"A valid OpenAPI 3.0.3 document containing only the operations of one category."}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"openapi.categories.{name}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/openapi/categories/example.json\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.openapiCategory({\n    \"name\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->openapiCategory([\n    'name' => 'example',\n]);\necho $result->requestId;"}]}},"/openapi/endpoints/{id}.json":{"get":{"operationId":"openapi.endpoints._id_","summary":"OpenAPI: one endpoint","description":"A valid OpenAPI 3 document with a single operation.","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"An endpoint id or SDK name, e.g. images.optimize or jobs.get (percent-encode \"{\" and \"}\"). List them with GET /v1/contract/endpoints."}],"responses":{"200":{"description":"A valid OpenAPI 3 document with a single operation.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"A valid OpenAPI 3.0.3 document containing a single operation."}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"openapi.endpoints.{id}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/openapi/endpoints/example.json\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.openapiEndpoint({\n    \"id\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->openapiEndpoint([\n    'id' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/account":{"get":{"operationId":"account","summary":"The authenticated customer's own real profile: name, email, status and creation date.","description":"The authenticated customer's own real profile: name, email, status and creation date.","tags":["Account"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"wp_linked":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","status","wp_linked","created_at"],"nullable":true},"plan_name":{"type":"string","nullable":true},"current_key_prefix":{"type":"string","nullable":true},"fallback":{"type":"object","properties":{"email":{"type":"string","nullable":true},"plan_name":{"type":"string","nullable":true}},"description":"Only when the key has no linked customer profile."},"note":{"type":"string"},"wordpress":{"type":"object","properties":{"available":{"type":"boolean"},"reason":{"type":"string","nullable":true},"site_url":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"can_delete":{"type":"boolean"},"memberships":{"type":"array","items":{"type":"object"}},"links":{"type":"object"}},"required":["available","can_delete","memberships","links"],"description":"What the membership site says about this member. `available` is false when the membership site cannot answer; the rest is then empty."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"account","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/account\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.account.get();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->account()->get();\necho $result->requestId;"}]}},"/v1/account/activity":{"get":{"operationId":"account.activity","summary":"Everything that happened on the customer account, newest first: sign-ins (device, app, address), sign-outs, API key changes, profile changes, privacy requests.","description":"Everything that happened on the customer account, newest first: sign-ins (device, app, address), sign-outs, API key changes, profile changes, privacy requests.","tags":["Account"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["all","signin","keys","plan","profile","privacy"],"default":"all","x-davix-h2i-enum":"AccountActivityType","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/api/account/activity.js"}},"description":"all (default), signin, keys, plan, profile (also settings) or privacy."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/api/account/activity.js"}},"description":"Rows per page, 1 to 100 (default 25)."},{"name":"before","in":"query","required":false,"schema":{"type":"integer","minimum":1,"x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/api/account/activity.js"}},"description":"The id of the last row of the previous page."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"next_before":{"type":"integer","nullable":true},"events":{"type":"array","items":{"type":"object"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["total","events"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired"],"x-davix-h2i-id":"account.activity","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/account/activity?type=all&limit=25&before=1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.account.activity({\n    \"type\": \"all\",\n    \"limit\": 25,\n    \"before\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->account()->activity([\n    'type' => 'all',\n    'limit' => 25,\n    'before' => 1,\n]);\necho $result->requestId;"}]}},"/v1/account/billing":{"get":{"operationId":"account.billing","summary":"The customer's billing history and the plans they can move to, read from the membership site with the exact pages to land on.","description":"The customer's billing history and the plans they can move to, read from the membership site with the exact pages to land on.","tags":["Account"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"reason":{"type":"string","nullable":true},"orders":{"type":"array","items":{"type":"object"}},"orders_available":{"type":"boolean"},"plans":{"type":"array","items":{"type":"object"}},"memberships":{"type":"array","items":{"type":"object"}},"links":{"type":"object"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["available","orders","plans","memberships","links"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"account.billing","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/account/billing\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.account.billing();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->account()->billing();\necho $result->requestId;"}]}},"/v1/account/privacy":{"get":{"operationId":"account.privacy","summary":"The customer's open and past privacy requests (download my data, delete my account).","description":"The customer's open and past privacy requests (download my data, delete my account).","tags":["Account"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"reason":{"type":"string","nullable":true},"requests":{"type":"array","items":{"type":"object"}},"can_delete":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["available","requests","can_delete"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"account.privacy","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/account/privacy\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.account.privacy();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->account()->privacy();\necho $result->requestId;"}]},"post":{"operationId":"account.privacy.request","summary":"Open a privacy request: download my data, or delete my account. You get an email with a confirmation link.","description":"Open a privacy request: download my data, or delete my account. You get an email with a confirmation link.","tags":["Account"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["export","erase"],"description":"export = download my data, erase = delete my account.","x-davix-h2i-enum":"AccountPrivacyRequestType","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but export or erase -> 400 invalid_parameter.","evidence":"src/api/account/privacy.js"}}},"required":["type"]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"request":{"type":"object"},"email":{"type":"string","nullable":true},"requests":{"type":"array","items":{"type":"object"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["request","requests"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","not_found","not_linked","request_open","wordpress_unavailable"],"x-davix-h2i-id":"account.privacy.request","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/account/privacy\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"type\":\"export\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.account.requestPrivacy({\n    \"type\": \"export\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->account()->requestPrivacy([\n    'type' => 'export',\n]);\necho $result->requestId;"}]}},"/v1/ai/analyze":{"post":{"operationId":"ai.analyze","summary":"Analyze (generic task runner)","description":"Run any registered analysis task by id through the universal request. Readiness: unbenchmarked (see GET /v1/ai/capabilities/core.analyze).\n\nClassification: hybrid. Deterministic stages: task registry dispatch.","tags":["AI","AI:core"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"task":{"type":"string","description":"A task id from GET /v1/ai/capabilities, e.g. \"documents.summarize\". The rest of the body must match that task's own request shape."},"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"The file(s) the chosen task reads (what each task accepts is listed with that task)."},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["task"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":0,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.analyze","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"core"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/analyze\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'task=example' \\\n  -F 'presetId=00000000-0000-4000-8000-000000000000' \\\n  -F 'validate_only=false'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.analyze({\n    \"task\": \"example\",\n    \"presetId\": \"00000000-0000-4000-8000-000000000000\",\n    \"validate_only\": false\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->analyze([\n    'task' => 'example',\n    'presetId' => '00000000-0000-4000-8000-000000000000',\n    'validate_only' => false,\n]);\necho $result->requestId;"}]}},"/v1/ai/capabilities":{"get":{"operationId":"ai.capabilities","summary":"AI capabilities","description":"Provider/registry status, limits and the readiness of every feature.\n\nClassification: deterministic. Deterministic stages: none.","tags":["AI","AI:capabilities"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"A discovery document (not the AI response envelope).","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"object","properties":{"provider":{"type":"string"},"configured":{"type":"boolean"},"enabled":{"type":"boolean"},"data_collection":{"type":"string"},"limits":{"type":"object"},"timeouts_ms":{"type":"object"},"reliability":{"type":"object"}},"required":["provider","configured","enabled","data_collection","limits","timeouts_ms","reliability"]},"model_registry":{"$ref":"#/components/schemas/AiCatalogStatus"},"benchmarks":{"type":"object","properties":{"generated_at":{"type":"string","format":"date-time","nullable":true},"entries":{"type":"integer"},"tasks_with_readiness":{"type":"integer"}},"required":["entries","tasks_with_readiness"]},"readiness_counts":{"type":"object","properties":{"production-ready":{"type":"integer"},"experimental":{"type":"integer"},"unbenchmarked":{"type":"integer"},"feature-unavailable":{"type":"integer"}},"description":"Number of AI features per readiness level."},"features_by_family":{"type":"object","additionalProperties":true,"description":"Feature summaries grouped by family (documents, extraction, ocr, images, generation, enhancement, content, models, capabilities, core)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["provider","model_registry","benchmarks","readiness_counts","features_by_family"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.capabilities","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":false,"studioReachable":true,"demoVisible":true,"group":"capabilities"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/ai/capabilities\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.capabilities.list();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->capabilities()->list();\necho $result->requestId;"}]}},"/v1/ai/capabilities/{feature}":{"get":{"operationId":"ai.capabilities._feature_","summary":"Feature capability","description":"Requirements, readiness, eligible-model count and benchmark evidence for one feature.\n\nClassification: deterministic. Deterministic stages: none.","tags":["AI","AI:capabilities"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"feature","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"A discovery document (not the AI response envelope).","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AiFeatureDetail"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.capabilities.{feature}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":false,"studioReachable":true,"demoVisible":true,"group":"capabilities"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/ai/capabilities/example\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.capabilities.get({\n    \"feature\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->capabilities()->get([\n    'feature' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/ai/chat":{"post":{"operationId":"ai.chat","summary":"Chat","description":"Text chat with any eligible model (no tools, no file access). Readiness: unbenchmarked (see GET /v1/ai/capabilities/core.chat).\n\nClassification: ai. Deterministic stages: model discovery and parameter validation.","tags":["AI","AI:core"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour a parameter.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"],"x-davix-h2i-enum":"AiRole"},"content":{"type":"string"}},"required":["role","content"]},"description":"The conversation so far, oldest first: each message has a role (system, user or assistant) and its content."},"generation":{"type":"object","properties":{"temperature":{"type":"number"},"max_tokens":{"type":"integer"},"top_p":{"type":"number"},"seed":{"type":"integer"}},"description":"Generation settings: temperature, max_tokens, top_p and seed."},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}}},"required":["messages"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.chat","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":false,"studioReachable":true,"demoVisible":true,"group":"core"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/chat\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"auto\",\"on_unsupported\":\"error\",\"messages\":[{\"role\":\"system\",\"content\":\"example\"}]}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.chat({\n    \"model\": \"auto\",\n    \"on_unsupported\": \"error\",\n    \"messages\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"example\"\n      }\n    ]\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->chat([\n    'model' => 'auto',\n    'on_unsupported' => 'error',\n    'messages' => [[\n            'role' => 'system',\n            'content' => 'example',\n        ]],\n]);\necho $result->requestId;"}]}},"/v1/ai/content/alt-text":{"post":{"operationId":"ai.content.alt-text","summary":"Image alt text","description":"Accessible alt text (length-limited). Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.alt-text).\n\nClassification: ai. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful","persuasive"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":20,"maximum":250,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.alt-text","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/alt-text\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.altText({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->altText([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/caption":{"post":{"operationId":"ai.content.caption","summary":"Captions","description":"Caption and hashtags for an image, document or text. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.caption).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful","persuasive"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":20,"maximum":500,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"hashtags":{"type":"integer","minimum":0,"maximum":15,"description":"How many hashtags to add.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.caption","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/caption\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.caption({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->caption([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/cover-letter":{"post":{"operationId":"ai.content.cover-letter","summary":"Cover letter writer","description":"A cover letter from your CV and a job description: only experience that is in the CV is used, requirements it does not show are listed as gaps; code assembles the letter and counts the words. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.cover-letter).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["professional","friendly","enthusiastic","confident","formal"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiContentCoverLetterTone","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"words":{"type":"integer","minimum":100,"maximum":600,"description":"About how many words the letter should have, from 100 to 600.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"job_title":{"type":"string","maxLength":120,"description":"The job you are applying for.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"company":{"type":"string","maxLength":120,"description":"The company you are applying to.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"applicant_name":{"type":"string","maxLength":100,"description":"Your name, used in the greeting and the closing.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"recipient":{"type":"string","maxLength":100,"description":"Who the letter is addressed to, for example the name of the hiring manager.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"emphasize":{"type":"array","maxItems":6,"items":{"type":"string","minLength":1,"maxLength":80,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Up to 6 strengths or experiences the letter should stress. One per line. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"format":{"type":"string","enum":["plain","html"],"description":"The shape of the result.","x-davix-h2i-enum":"AiFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"emphasize":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":0,"ceiling":5,"directFiles":5,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.content.cover-letter","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/cover-letter\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.coverLetter({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->coverLetter([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/document":{"post":{"operationId":"ai.content.document","summary":"Document writer","description":"Write a letter, report, article, proposal, memo or policy from your instructions and source material; code counts the words, assembles the text and lists the placeholders to fill in. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.document).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"kind":{"type":"string","enum":["letter","report","article","proposal","memo","essay","press-release","policy","other"],"description":"The kind of document to write: letter, report, article, proposal, memo, essay, press release, policy or other.","x-davix-h2i-enum":"AiKind","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","persuasive","playful"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"words":{"type":"integer","minimum":50,"maximum":5000,"description":"About how many words the document should have, from 50 to 5,000.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"headings":{"type":"boolean","description":"Switch on to split the document into parts with headings.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"audience":{"type":"string","maxLength":150,"description":"Who the text is written for, so the wording fits them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"title":{"type":"string","maxLength":150,"description":"A title to use in the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"include_summary":{"type":"boolean","description":"Switch on to add a short summary at the top.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"format":{"type":"string","enum":["markdown","plain","html"],"description":"The shape of the result.","x-davix-h2i-enum":"AiContentDocumentFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["instructions"]},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":0,"ceiling":5,"directFiles":5,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.content.document","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/document\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.document({\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->document([\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/document-description":{"post":{"operationId":"ai.content.document-description","summary":"Document description","description":"Description and one-liner for a document. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.document-description).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful","persuasive"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":50,"maximum":2000,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"output":{"type":"string","enum":["separate","combined"],"default":"combined","description":"With several files: `separate` analyzes each file on its own and returns one result per file; `combined` treats the files as one document set and returns one result.","x-davix-h2i-enum":"AiOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/platform/uploads/fan-out.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out-on-separate","multipleToggle":true,"either":true,"outputParam":{"name":"output","separate":"separate","combined":"combined","default":"combined"}},"x-davix-h2i-id":"ai.content.document-description","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/document-description\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.documentDescription({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->documentDescription([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/email-reply":{"post":{"operationId":"ai.content.email-reply","summary":"Reply to an email","description":"A ready-to-send reply to the email you give, in the tone and length you choose, covering the points you list; missing facts are left as marked placeholders, never invented. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.email-reply).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","apologetic","firm","enthusiastic"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiContentEmailReplyTone","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"length":{"type":"string","enum":["short","medium","long"],"description":"How long the reply is: short, medium or long.","x-davix-h2i-enum":"AiLength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"points":{"type":"array","maxItems":10,"items":{"type":"string","minLength":1,"maxLength":300,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Up to 10 things the reply must say. One per line. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"sender_name":{"type":"string","minLength":1,"maxLength":100,"description":"Your name, used to sign the reply.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"recipient_name":{"type":"string","minLength":1,"maxLength":100,"description":"The name of the person you are replying to, used in the greeting.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"sign_off":{"type":"string","minLength":1,"maxLength":60,"description":"The closing line before your name, for example \"Kind regards\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"include_subject":{"type":"boolean","description":"Switch on to also write a subject line for the reply.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"variants":{"type":"integer","minimum":1,"maximum":3,"description":"How many different versions to produce.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"format":{"type":"string","enum":["plain","html"],"description":"The shape of the result.","x-davix-h2i-enum":"AiFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":100,"maximum":5000,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"points":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.email-reply","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/email-reply\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.emailReply({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->emailReply([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/html-design":{"post":{"operationId":"ai.content.html-design","summary":"Design to HTML","description":"Turn a screenshot or mockup of a page into one HTML file with its CSS; code takes the page apart and rebuilds it (no scripts, no remote files, remote pictures replaced by placeholders), sets the language, title and viewport, and saves the file. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.html-design).\n\nClassification: ai. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","enum":["stylesheet","inline"],"description":"Where the CSS goes: stylesheet puts it in a <style> block, inline puts it in each element.","x-davix-h2i-enum":"AiContentHtmlDesignStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"responsive":{"type":"boolean","description":"Switch on (the default) to make the page fit phones and tablets as well as large screens.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"lang":{"type":"string","minLength":2,"maxLength":35,"description":"The language of the page, written as a language code such as en or de. It is used for the page's lang attribute (default en).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"page_title":{"type":"string","maxLength":150,"description":"The title shown in the browser tab.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"semantic":{"type":"boolean","description":"Switch on (the default) to build the page from meaningful parts (header, nav, main, section, footer) instead of plain boxes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"placeholder_images":{"type":"boolean","description":"Switch on to turn every picture into a grey placeholder. Off keeps pictures that are not embedded.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.html-design","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/html-design\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.htmlDesign({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->htmlDesign([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/listing":{"post":{"operationId":"ai.content.listing","summary":"Marketplace listing","description":"A listing for eBay, Etsy, Amazon, Facebook, OLX or Vinted from photos and notes: title, description, bullet points, tags and what is still unknown; code applies the title and tag limits of the platform. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.listing).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"platform":{"type":"string","enum":["generic","ebay","etsy","amazon","facebook","olx","vinted"],"description":"The platform the text is written for, so length and style follow its customs.","x-davix-h2i-enum":"AiContentListingPlatform","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"condition":{"type":"string","enum":["new","like-new","good","fair","for-parts"],"description":"The state of the item: new, like new, good, fair or for parts.","x-davix-h2i-enum":"AiCondition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","persuasive","playful"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"price":{"type":"string","maxLength":40,"description":"The price to show in the listing, written as you want it to appear.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"currency":{"type":"string","minLength":3,"maxLength":3,"pattern":"^[A-Za-z]{3}$","description":"The currency to use for prices and amounts.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tags":{"type":"integer","minimum":0,"maximum":20,"description":"Tags to attach to or use for the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"bullets":{"type":"integer","minimum":0,"maximum":10,"description":"How many bullet points the listing should have, from 0 to 10.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"location":{"type":"string","maxLength":80,"description":"The place the text or picture refers to.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"keywords":{"type":"array","maxItems":10,"items":{"type":"string","minLength":1,"maxLength":40,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Words the result should include. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"keywords":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":0,"ceiling":5,"directFiles":5,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.content.listing","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/listing\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.listing({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->listing([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/product-description":{"post":{"operationId":"ai.content.product-description","summary":"Product description from images","description":"Description grounded in what is visible; unknown details are listed, not invented. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.product-description).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful","persuasive"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":100,"maximum":3000,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"product_name":{"type":"string","maxLength":150,"description":"The name of the product, used in the description.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.product-description","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/product-description\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.productDescription({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->productDescription([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/quiz":{"post":{"operationId":"ai.content.quiz","summary":"Quiz and flashcards","description":"Make questions from documents or text: multiple choice, true/false, short answer, flashcards or a mix; code makes each question fit its kind (exactly one correct option, distinct options), drops duplicates, shuffles the options in a repeatable way, checks the source quotes and the count, and can export CSV, JSON or an Anki import file. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.quiz).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"type":{"type":"string","enum":["multiple_choice","true_false","short_answer","flashcards","mixed"],"description":"The kind of questions: multiple choice, true or false, short answer, flash cards, or a mix.","x-davix-h2i-enum":"AiContentQuizType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"count":{"type":"integer","minimum":1,"maximum":50,"description":"How many items to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"difficulty":{"type":"string","enum":["easy","medium","hard","mixed"],"description":"How hard the result should be.","x-davix-h2i-enum":"AiDifficulty","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"choices":{"type":"integer","minimum":2,"maximum":6,"description":"How many answer choices each question has, from 2 to 6 (default 4).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"shuffle":{"type":"boolean","description":"Switch on (the default) so the right answer is not always the first choice.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"export":{"type":"string","enum":["none","csv","json","anki"],"description":"Also give the quiz as a file in one of the listed formats (anki makes flash cards). none gives no file.","x-davix-h2i-enum":"AiExport","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.quiz","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/quiz\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.quiz({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->quiz([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/seo":{"post":{"operationId":"ai.content.seo","summary":"SEO metadata","description":"Title, meta description, keywords, slug and Open Graph fields with enforced limits. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.seo).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful","persuasive"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target_keyword":{"type":"string","maxLength":100,"description":"The search word or phrase the page should rank for.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.seo","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/seo\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.seo({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->seo([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/slides":{"post":{"operationId":"ai.content.slides","summary":"Slides from a document","description":"Turn a document into a slide outline: a title, slides with short bullets and speaker notes; code enforces the slide count and the bullet limits and builds a Markdown outline. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.slides).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"slides":{"type":"integer","minimum":2,"maximum":40,"description":"How many slides to make, from 2 to 40.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"bullets":{"type":"integer","minimum":1,"maximum":8,"description":"How many bullet points on each slide, from 1 to 8.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"notes":{"type":"boolean","description":"Switch on to add speaker notes to every slide.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"audience":{"type":"string","maxLength":150,"description":"Who the text is written for, so the wording fits them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"title_slide":{"type":"boolean","description":"Switch on to start with a title slide.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","persuasive","playful"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_words_per_bullet":{"type":"integer","minimum":3,"maximum":40,"description":"The longest a bullet point may be, in words (3 to 40).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":0,"ceiling":5,"directFiles":5,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.content.slides","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/slides\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.slides({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->slides([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/social-post":{"post":{"operationId":"ai.content.social-post","summary":"Social post from media","description":"Platform-length-limited post with hashtags. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.social-post).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful","persuasive"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"platform":{"type":"string","enum":["twitter","linkedin","facebook","instagram","threads","generic"],"description":"The platform the text is written for, so length and style follow its customs.","x-davix-h2i-enum":"AiContentSocialPostPlatform","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"hashtags":{"type":"integer","minimum":0,"maximum":15,"description":"How many hashtags to add.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"call_to_action":{"type":"boolean","description":"Switch on to end the post with a call to action, for example \"Read more\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.social-post","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/social-post\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.socialPost({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->socialPost([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/tags":{"post":{"operationId":"ai.content.tags","summary":"Tags","description":"Ranked tags for content. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.tags).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful","persuasive"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max":{"type":"integer","minimum":1,"maximum":50,"description":"The largest number of results to return.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.tags","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/tags\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.tags({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->tags([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/title":{"post":{"operationId":"ai.content.title","summary":"Titles","description":"Titles with alternatives. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.title).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful","persuasive"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiTone2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":10,"maximum":200,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"alternatives":{"type":"integer","minimum":0,"maximum":5,"description":"How many alternative results to return besides the best one.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.title","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/title\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.title({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->title([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/content/translate":{"post":{"operationId":"ai.content.translate","summary":"Translate text","description":"Translate text or UI strings into a language, with formality, a glossary and checks that placeholders such as {{name}} or %s survive. Readiness: unbenchmarked (see GET /v1/ai/capabilities/content.translate).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation, deterministic length/format validation of the result.","tags":["AI","AI:content"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target_language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z][A-Za-z\\-_ ()]{1,34}$","description":"The language to translate into, as a language code such as \"de\" or \"ja\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"source_language":{"type":"string","minLength":2,"maxLength":35,"description":"The language of the input, as a language code. Leave empty to detect it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"formality":{"type":"string","enum":["formal","informal","neutral"],"description":"How formal the translation is: formal, informal or neutral.","x-davix-h2i-enum":"AiFormality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"glossary":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":100,"description":"Sets the source of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target":{"type":"string","minLength":1,"maxLength":100,"description":"What the tool should aim at or work on.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["source","target"],"additionalProperties":false,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Words that must always be translated the same way: the word on the left, its translation on the right. Up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"preserve_placeholders":{"type":"boolean","description":"Switch on (the default) to keep placeholders such as {{name}}, {0}, %s and HTML tags exactly as they are. A warning tells you if one changed.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"keep_line_breaks":{"type":"boolean","description":"Switch on (the default) to keep the line breaks. Off puts the translation on one line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"alternatives":{"type":"integer","minimum":0,"maximum":3,"description":"How many alternative results to return besides the best one.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["target_language"]},"encoding":{"generation":{"contentType":"application/json"},"glossary":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.content.translate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"content"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/content/translate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'target_language=xx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.content.translate({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"target_language\": \"xx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->content()->translate([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'target_language' => 'xx',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/action-items":{"post":{"operationId":"ai.documents.action-items","summary":"Extract action items","description":"Tasks, owners, due dates and priorities. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.action-items).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"output":{"type":"string","enum":["separate","combined"],"default":"combined","description":"With several files: `separate` analyzes each file on its own and returns one result per file; `combined` treats the files as one document set and returns one result.","x-davix-h2i-enum":"AiOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/platform/uploads/fan-out.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out-on-separate","multipleToggle":true,"either":true,"outputParam":{"name":"output","separate":"separate","combined":"combined","default":"combined"}},"x-davix-h2i-id":"ai.documents.action-items","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/action-items\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.actionItems({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->actionItems([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/analyze-contract":{"post":{"operationId":"ai.documents.analyze-contract","summary":"Analyze a contract","description":"Parties, dates, obligations, clauses, red flags (for review; not legal advice). Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.analyze-contract).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"perspective":{"type":"string","maxLength":120,"description":"Whose side to read the contract from, for example \"the tenant\" or \"the supplier\". The risks are judged for that side.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.analyze-contract","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/analyze-contract\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.analyzeContract({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->analyzeContract([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/analyze-form":{"post":{"operationId":"ai.documents.analyze-form","summary":"Analyze forms","description":"Native AcroForm fields (deterministic) plus interpretation of scanned/filled forms. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.analyze-form).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, AcroForm field extraction.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.analyze-form","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/analyze-form\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.analyzeForm({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->analyzeForm([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/analyze-risks":{"post":{"operationId":"ai.documents.analyze-risks","summary":"Detect risks and issues","description":"Risks, inconsistencies and gaps with severity (for review). Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.analyze-risks).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"domain":{"type":"string","maxLength":120,"description":"The field the document belongs to, for example \"construction\" or \"software\", so the risks fit it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"output":{"type":"string","enum":["separate","combined"],"default":"combined","description":"With several files: `separate` analyzes each file on its own and returns one result per file; `combined` treats the files as one document set and returns one result.","x-davix-h2i-enum":"AiOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/platform/uploads/fan-out.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out-on-separate","multipleToggle":true,"either":true,"outputParam":{"name":"output","separate":"separate","combined":"combined","default":"combined"}},"x-davix-h2i-id":"ai.documents.analyze-risks","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/analyze-risks\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.analyzeRisks({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->analyzeRisks([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/analyze-table":{"post":{"operationId":"ai.documents.analyze-table","summary":"Analyze tables","description":"Extract tables (layout-preserving text) and interpret them. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.analyze-table).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, layout-preserving text extraction (pdftotext -layout), spreadsheet parsing (ExcelJS).","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"table_hint":{"type":"string","maxLength":300,"description":"A few words that help find the right table, for example \"the price list on page 2\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.analyze-table","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/analyze-table\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.analyzeTable({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->analyzeTable([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/chart":{"post":{"operationId":"ai.documents.chart","summary":"Chart from a request","description":"Describe the chart you want in words; the model picks type and columns (and a SQL summary), code runs the SQL and draws the chart as PNG or SVG. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.chart).\n\nClassification: hybrid. Deterministic stages: table files read into real tables, SQL run on the data (SELECT only), columns checked against the data, chart drawn with Vega-Lite.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":3,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 3.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"type":{"type":"string","enum":["bar","line","area","scatter","pie","donut","stacked-bar","grouped-bar","histogram"],"description":"The kind of chart: bar, line, area, scatter, pie, donut, stacked bar, grouped bar or histogram.","x-davix-h2i-enum":"Type","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output":{"type":"string","enum":["png","svg"],"description":"The picture format of the chart: png or svg.","x-davix-h2i-enum":"AiDocumentsChartOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"theme":{"type":"string","enum":["light","dark"],"description":"The colour scheme of the chart: light or dark.","x-davix-h2i-enum":"Theme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"width":{"type":"integer","minimum":100,"maximum":4000,"description":"Width of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"height":{"type":"integer","minimum":100,"maximum":4000,"description":"Height of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","instructions"]},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":3,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.chart","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/chart\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.chart({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->chart([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/checklist":{"post":{"operationId":"ai.documents.checklist","summary":"Review documents against a checklist","description":"Check documents against your list of requirements: each requirement is marked met, partly met, not met or unknown with a quote; a quote that is not in the document is not believed; code counts, scores and gives the verdict. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.checklist).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, quote verification against the document text, score and verdict calculation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"checklist":{"type":"array","minItems":1,"maxItems":60,"items":{"type":"string","minLength":2,"maxLength":300,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"The requirements to check the document against. One per line, up to 60. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strictness":{"type":"string","enum":["lenient","normal","strict"],"description":"How strictly each requirement is judged: lenient, normal or strict.","x-davix-h2i-enum":"AiDocumentsChecklistStrictness","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pass_threshold":{"type":"number","minimum":0,"maximum":100,"description":"The score in percent (0 to 100) that counts as passed. The default is 80.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["checklist"]},"encoding":{"generation":{"contentType":"application/json"},"checklist":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.checklist","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/checklist\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'checklist=[\"xx\"]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.checklist({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"checklist\": [\n      \"xx\"\n    ]\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->checklist([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'checklist' => ['xx'],\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/classify":{"post":{"operationId":"ai.documents.classify","summary":"Classify documents","description":"Assign a document to a label (yours or generic). Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.classify).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"labels":{"type":"array","minItems":2,"maxItems":50,"items":{"type":"string","minLength":1,"maxLength":80,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"The categories to choose from. One per line, up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"labels":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.classify","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/classify\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.classify({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->classify([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/column":{"post":{"operationId":"ai.documents.column","summary":"AI column","description":"Add a column to a table: the instructions say what to work out for each row (a category, a sentiment, a cleaned value, a number); code checks the rows, the type and the categories. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.column).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"column_name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the new column that holds the category.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"type":{"type":"string","enum":["text","number","category","boolean"],"description":"What kind of value the new column holds: text, number, category or true/false.","x-davix-h2i-enum":"AiDocumentsColumnType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"categories":{"type":"array","minItems":2,"maxItems":30,"items":{"type":"string","minLength":1,"maxLength":60,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"The categories to choose from. One per line, up to 30. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_rows":{"type":"integer","minimum":1,"maximum":2000,"description":"The largest number of table rows to read.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"sheet":{"type":"string","maxLength":100,"description":"The name or number of the worksheet to use.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"allow_other":{"type":"boolean","description":"Switch on to allow \"other\" when a row fits none of the categories.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"reasons":{"type":"boolean","description":"Switch on to add a second column with the reason for each choice.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["instructions"]},"encoding":{"generation":{"contentType":"application/json"},"categories":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.column","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/column\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.column({\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->column([\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/compare":{"post":{"operationId":"ai.documents.compare","summary":"Compare versions of a document","description":"Explain what changed between an older and a newer document and how much it matters; the similarity and word counts come from a real diff. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.compare).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, word-level diff of the two texts (similarity, words added and removed).","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":2,"maxItems":2,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 2."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"focus":{"type":"string","maxLength":500,"description":"What the analysis should concentrate on.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":2,"ceiling":2,"directFiles":2,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.documents.compare","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/compare\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.compare({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->compare([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/compare-offers":{"post":{"operationId":"ai.documents.compare-offers","summary":"Compare offers","description":"Two to five offers or quotes side by side on the criteria that matter, with pros, cons, caveats and an optional recommendation; code makes every offer complete and finds the cheapest. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.compare-offers).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":2,"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"criteria":{"type":"array","minItems":1,"maxItems":15,"items":{"type":"string","minLength":1,"maxLength":60,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"What to compare the offers on, for example price, delivery time, warranty. One per line, up to 15. Empty lets the AI choose the most important ones. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"priorities":{"type":"string","maxLength":300,"description":"What matters most to you, in words. The recommendation takes it into account.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"currency":{"type":"string","minLength":3,"maxLength":3,"pattern":"^[A-Za-z]{3}$","description":"The currency to use for prices and amounts.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"recommend":{"type":"boolean","description":"Whether to add a clear recommendation at the end.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"period_months":{"type":"integer","minimum":1,"maximum":120,"description":"The number of months to calculate the total cost for (1 to 120).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"},"criteria":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":2,"ceiling":5,"directFiles":5,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.documents.compare-offers","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/compare-offers\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.compareOffers({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->compareOffers([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/correct":{"post":{"operationId":"ai.documents.correct","summary":"Correct grammar and spelling","description":"Proofread text; returns corrected text and a deterministic diff. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.correct).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, word-level diff of original vs corrected.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"mode":{"type":"string","enum":["grammar","spelling","both"],"description":"The working mode of the tool; the allowed values are listed with the parameter.","x-davix-h2i-enum":"AiMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.correct","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/correct\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.correct({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->correct([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/detect-pii":{"post":{"operationId":"ai.documents.detect-pii","summary":"Detect personal data","description":"Find personal data (names, contacts, ids, financial data, health) with a risk level; patterns add cards, IBANs, e-mails and numbers; values are masked by default. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.detect-pii).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, pattern detection with checksums (cards by Luhn, IBAN by mod 97), values masked unless options.mask is false.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"types":{"type":"array","minItems":1,"maxItems":11,"items":{"type":"string","enum":["name","email","phone","address","id_number","financial","date_of_birth","health","credential","ip_address","other"],"description":"Sets the item of the result. Choose one of the allowed values listed with the parameter.","x-davix-h2i-enum":"AiDocumentsDetectPiiTypesItem","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Only look for these kinds of personal data. Empty looks for all of them. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"mask":{"type":"boolean","description":"Hide sensitive values in the result instead of showing them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"types":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.detect-pii","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/detect-pii\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.detectPii({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->detectPii([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/detect-type":{"post":{"operationId":"ai.documents.detect-type","summary":"Detect document type","description":"Deterministic file-format detection plus the semantic document type. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.detect-type).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, magic-byte file format detection, PDF metadata/page count.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.detect-type","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/detect-type\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.detectType({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->detectType([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/entities":{"post":{"operationId":"ai.documents.entities","summary":"Entities and timeline","description":"The people, organizations, places, dates, amounts and events of a document, with a dated timeline; code merges repeats, sorts the timeline and counts the mentions in the text. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.entities).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"types":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string","enum":["person","organization","place","date","money","event","product","law"],"description":"Sets the item of the result. Choose one of the allowed values listed with the parameter.","x-davix-h2i-enum":"AiDocumentsEntitiesTypesItem","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Only find these kinds of things: people, organizations, places, dates, money, events, products or laws. Empty finds all. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_entities":{"type":"integer","minimum":1,"maximum":200,"description":"The largest number of entities to return.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"timeline":{"type":"boolean","description":"Switch on to also list the dated events in time order.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"min_mentions":{"type":"integer","minimum":1,"maximum":20,"description":"Only list an entity that appears at least this many times (1 to 20).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"types":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.entities","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/entities\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.entities({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->entities([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/extract":{"post":{"operationId":"ai.documents.extract","summary":"Extract key information","description":"Extract fields, entities, dates, amounts/currency and addresses with verified evidence. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.extract).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, ISO date / currency / number validation, evidence verification against page text.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"fields":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_ .\\-]*$","description":"Sets the name of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"type":{"type":"string","enum":["string","number","date","currency","boolean","list"],"default":"string","description":"The kind of result to produce.","x-davix-h2i-enum":"AiType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":{"type":"string","maxLength":300,"description":"Sets the description of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["name","type"],"additionalProperties":false,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"The values to find: a name, a type and a short description for each. Up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"include":{"type":"array","maxItems":4,"items":{"type":"string","enum":["entities","dates","amounts","addresses"],"description":"Sets the item of the result. Choose one of the allowed values listed with the parameter.","x-davix-h2i-enum":"AiIncludeItem","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Also collect these kinds of values: entities, dates, amounts or addresses. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"fields":{"contentType":"application/json"},"include":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.extract","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/extract\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.extract({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->extract([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/fill-form":{"post":{"operationId":"ai.documents.fill-form","summary":"Fill a PDF form","description":"Fill the fields of a PDF form from other documents or text: the form fields are read by code, the model matches the information to them, and code checks every value, fills the PDF and says which values it could not find in your sources. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.fill-form).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, AcroForm field extraction, value fitting per field type (checkbox, radio, dropdown, length), form filling and flattening.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"flatten":{"type":"boolean","description":"Write the result as flat rows, one value per cell, instead of nested data.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"overwrite":{"type":"boolean","description":"Replace values that are already filled in.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"only_fields":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":300,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Fill only these fields of the form. One field name per line. Empty fills all fields. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"skip_fields":{"type":"array","maxItems":200,"items":{"type":"string","minLength":1,"maxLength":300,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Leave these fields of the form empty. One field name per line. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"only_verified":{"type":"boolean","description":"Switch on to fill only values that appear in the other documents or in the text, never a guess.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"},"only_fields":{"contentType":"application/json"},"skip_fields":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":5,"directFiles":5,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.documents.fill-form","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/fill-form\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.fillForm({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->fillForm([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/formula":{"post":{"operationId":"ai.documents.formula","summary":"Formula helper","description":"Write, explain or fix a spreadsheet formula for Excel, Google Sheets or LibreOffice; code checks the brackets, the starting = and the argument separator. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.formula).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"dialect":{"type":"string","enum":["excel","sheets","libreoffice"],"description":"The spreadsheet program the formula is for: excel, sheets or libreoffice.","x-davix-h2i-enum":"AiDialect","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"mode":{"type":"string","enum":["write","explain","fix"],"description":"The working mode of the tool; the allowed values are listed with the parameter.","x-davix-h2i-enum":"AiDocumentsFormulaMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"alternatives":{"type":"integer","minimum":0,"maximum":3,"description":"How many alternative results to return besides the best one.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"locale":{"type":"string","enum":["comma","semicolon"],"description":"The mark that separates the parts of a formula in your program: comma or semicolon.","x-davix-h2i-enum":"AiLocale","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"cell_layout":{"type":"string","maxLength":300,"description":"Describe where the data is, for example \"dates in column A, amounts in column B, headers in row 1\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["instructions"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.formula","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/formula\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.formula({\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->formula([\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/humanize":{"post":{"operationId":"ai.documents.humanize","summary":"Humanize / change tone","description":"Rewrite text so it sounds natural, in the tone and strength you choose; code checks that every number, name, link and placeholder of the original is still there. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.humanize).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["casual","friendly","professional","formal","confident","simple","warm"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiDocumentsHumanizeTone","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strength":{"type":"string","enum":["light","medium","strong"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiDocumentsHumanizeStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"keep_length":{"type":"boolean","description":"Switch on to keep the text about as long as it was.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"audience":{"type":"string","maxLength":120,"description":"Who the text is written for, so the wording fits them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"variants":{"type":"integer","minimum":0,"maximum":3,"description":"How many different versions to produce.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"avoid":{"type":"array","maxItems":15,"items":{"type":"string","minLength":1,"maxLength":40,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Words or phrases the result must not use. One per line, up to 15. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"avoid":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.humanize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/humanize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.humanize({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->humanize([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/insights":{"post":{"operationId":"ai.documents.insights","summary":"Data insights","description":"What a table shows: findings with their evidence, anomalies, chart suggestions and questions to ask next; code checks that every named column exists. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.insights).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_insights":{"type":"integer","minimum":1,"maximum":15,"description":"The largest number of findings to return.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"focus":{"type":"string","maxLength":200,"description":"What the analysis should concentrate on.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"audience":{"type":"string","maxLength":120,"description":"Who the text is written for, so the wording fits them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"charts":{"type":"boolean","description":"Switch on to also make charts for the findings.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"sheet":{"type":"string","maxLength":100,"description":"The name or number of the worksheet to use.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.insights","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/insights\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.insights({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->insights([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/keywords":{"post":{"operationId":"ai.documents.keywords","summary":"Generate keywords","description":"Key terms ranked by relevance. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.keywords).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max":{"type":"integer","minimum":1,"maximum":50,"description":"The largest number of results to return.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.keywords","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/keywords\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.keywords({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->keywords([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/localize":{"post":{"operationId":"ai.documents.localize","summary":"Translate a localization file","description":"Translate the strings of a JSON, YAML, PO, properties, XLIFF or ARB file: keys stay as they are, placeholders are checked, the glossary is applied and a file in the same format is rebuilt. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.localize).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target_language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z][A-Za-z\\-_ ()]{1,34}$","description":"The language to translate into, as a language code such as \"de\" or \"ja\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"source_language":{"type":"string","minLength":2,"maxLength":35,"description":"The language of the input, as a language code. Leave empty to detect it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"formality":{"type":"string","enum":["formal","informal","neutral"],"description":"How formal the text is: formal, informal or neutral.","x-davix-h2i-enum":"AiFormality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"glossary":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":100,"description":"Sets the source of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target":{"type":"string","minLength":1,"maxLength":100,"description":"What the tool should aim at or work on.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["source","target"],"additionalProperties":false,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Words that must always be translated the same way: the word on the left, its translation on the right. Up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_entries":{"type":"integer","minimum":1,"maximum":1000,"description":"The largest number of entries to return.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"context":{"type":"string","maxLength":300,"description":"Where the text is used, for example \"button in a mobile app\", so the wording fits.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["target_language"]},"encoding":{"generation":{"contentType":"application/json"},"glossary":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.localize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/localize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'target_language=xx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.localize({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"target_language\": \"xx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->localize([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'target_language' => 'xx',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/metadata":{"post":{"operationId":"ai.documents.metadata","summary":"Generate metadata","description":"Suggested title/subject/keywords plus existing PDF metadata (deterministic). Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.metadata).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, existing PDF Info metadata read.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.metadata","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/metadata\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.metadata({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->metadata([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/mind-map":{"post":{"operationId":"ai.documents.mind-map","summary":"Mind map from a document","description":"The ideas of a document as a mind map; code checks the tree (parents, loops, depth, size) and writes it as an outline and as a Mermaid mind map. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.mind-map).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_depth":{"type":"integer","minimum":1,"maximum":5,"description":"How many levels deep the result may go.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_nodes":{"type":"integer","minimum":5,"maximum":150,"description":"The largest number of nodes in the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"root":{"type":"string","maxLength":100,"description":"The central topic of the map. Empty lets the AI choose it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"branches":{"type":"integer","minimum":2,"maximum":12,"description":"How many main branches the map has, from 2 to 12.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.mind-map","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/mind-map\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.mindMap({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->mindMap([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/qa":{"post":{"operationId":"ai.documents.qa","summary":"Document question answering","description":"Answer a question from one or more documents (multi-document Q&A) with citations. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.qa).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, BM25 page retrieval for long documents.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"question":{"type":"string","description":"The question to answer."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"answer_style":{"type":"string","enum":["concise","detailed"],"description":"How the answer is written: short, detailed or step by step as the allowed values say.","x-davix-h2i-enum":"AiAnswerStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"output":{"type":"string","enum":["separate","combined"],"default":"combined","description":"With several files: `separate` analyzes each file on its own and returns one result per file; `combined` treats the files as one document set and returns one result.","x-davix-h2i-enum":"AiOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/platform/uploads/fan-out.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["question"]},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out-on-separate","multipleToggle":true,"either":true,"outputParam":{"name":"output","separate":"separate","combined":"combined","default":"combined"}},"x-davix-h2i-id":"ai.documents.qa","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/qa\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'question=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.qa({\n    \"on_unsupported\": \"error\",\n    \"question\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->qa([\n    'on_unsupported' => 'error',\n    'question' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/rename":{"post":{"operationId":"ai.documents.rename","summary":"Rename files from their content","description":"Suggest a file name for each document from what it says (date, type, party ...), following a pattern if you give one; code cleans the names (no path characters, separator, case, length, extension), makes them unique and can return the files renamed in a ZIP. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.rename).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, file name sanitising and uniqueness, extension handling, ZIP packaging.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pattern":{"type":"string","maxLength":200,"description":"How the new names are built, for example {date}_{type}_{party}.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"separator":{"type":"string","enum":["_","-"," ","."],"description":"The mark between the parts of a name: _ - a space or a dot.","x-davix-h2i-enum":"AiSeparator","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"lowercase":{"type":"boolean","description":"Switch on to write the new names in lowercase.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":20,"maximum":200,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"keep_extension":{"type":"boolean","description":"Switch on to keep the file extension (such as .pdf) on the new name.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"rename_files":{"type":"boolean","description":"Switch on to also return the files themselves, renamed, in a ZIP.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.rename","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/rename\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.rename({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->rename([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/resume-match":{"post":{"operationId":"ai.documents.resume-match","summary":"Match a resume to a job","description":"Compare a resume with a job description: every requirement is marked met, partly met or missing with a quote from the resume; quotes are checked against the resume, keywords already in the resume are not suggested, and code computes the weighted match score and the verdict. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.resume-match).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, quote verification against the resume text, weighted score and verdict calculation.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"focus":{"type":"string","enum":["all","skills","experience"],"description":"What the analysis should concentrate on.","x-davix-h2i-enum":"AiFocus","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"must_have_weight":{"type":"number","minimum":1,"maximum":5,"description":"How many times more a must-have requirement counts than a nice-to-have, from 1 to 5 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","text"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.resume-match","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/resume-match\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'text=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.resumeMatch({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"text\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->resumeMatch([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'text' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/rewrite":{"post":{"operationId":"ai.documents.rewrite","summary":"Rewrite documents","description":"Rewrite text in a chosen style without adding facts. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.rewrite).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","enum":["formal","casual","concise","friendly","academic","marketing","simplified"],"description":"How the rewritten text sounds: formal, casual, concise, friendly, academic, marketing or simplified.","x-davix-h2i-enum":"AiDocumentsRewriteStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target_length":{"type":"string","enum":["shorter","same","longer"],"description":"Make the text shorter, keep the same length, or make it longer.","x-davix-h2i-enum":"AiTargetLength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.rewrite","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/rewrite\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.rewrite({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->rewrite([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/split":{"post":{"operationId":"ai.documents.split","summary":"Split a mixed scan","description":"Find where one document ends and the next begins in a scan of mixed papers; code makes the page ranges valid (no overlaps, gaps kept as their own parts) and cuts the PDF into one file per document in a ZIP. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.split).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, page range validation, overlap and gap handling, PDF cutting, ZIP packaging.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_documents":{"type":"integer","minimum":1,"maximum":100,"description":"The largest number of documents to use.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"hints":{"type":"string","maxLength":500,"description":"What kinds of papers to expect, for example \"invoices and delivery notes\". It helps to find where one ends.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"names":{"type":"string","enum":["title","type","numbered"],"description":"How the files in the ZIP are named: by title, by type, or by a number.","x-davix-h2i-enum":"AiNames","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"gaps":{"type":"string","enum":["keep","drop"],"description":"Pages that belong to no document: keep them as a part (the default) or leave them out.","x-davix-h2i-enum":"AiGaps","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"number_files":{"type":"boolean","description":"Switch on (the default) to put 01, 02 ... in front of the names so the order is kept.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.split","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/split\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.split({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->split([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/summarize":{"post":{"operationId":"ai.documents.summarize","summary":"Summarize documents","description":"Summarise one or more documents with cited key points. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.summarize).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"length":{"type":"string","enum":["short","medium","long"],"description":"How long the summary is: short, medium or long.","x-davix-h2i-enum":"AiLength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","enum":["paragraph","bullets"],"description":"How the summary is laid out: as a paragraph or as bullet points.","x-davix-h2i-enum":"AiDocumentsSummarizeStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"focus":{"type":"string","maxLength":500,"description":"What the analysis should concentrate on.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"output":{"type":"string","enum":["separate","combined"],"default":"combined","description":"With several files: `separate` analyzes each file on its own and returns one result per file; `combined` treats the files as one document set and returns one result.","x-davix-h2i-enum":"AiOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/platform/uploads/fan-out.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out-on-separate","multipleToggle":true,"either":true,"outputParam":{"name":"output","separate":"separate","combined":"combined","default":"combined"}},"x-davix-h2i-id":"ai.documents.summarize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/summarize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.summarize({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->summarize([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/title":{"post":{"operationId":"ai.documents.title","summary":"Generate a title","description":"A clear title with alternatives. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.title).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":10,"maximum":200,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"alternatives":{"type":"integer","minimum":0,"maximum":5,"description":"How many alternative results to return besides the best one.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"output":{"type":"string","enum":["separate","combined"],"default":"combined","description":"With several files: `separate` analyzes each file on its own and returns one result per file; `combined` treats the files as one document set and returns one result.","x-davix-h2i-enum":"AiOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/platform/uploads/fan-out.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out-on-separate","multipleToggle":true,"either":true,"outputParam":{"name":"output","separate":"separate","combined":"combined","default":"combined"}},"x-davix-h2i-id":"ai.documents.title","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/title\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.title({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->title([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/transform":{"post":{"operationId":"ai.documents.transform","summary":"Data from a request","description":"Describe the table you want in words; the model writes one SQL query, code runs it on your files and gives the result as CSV, TSV, JSON or XLSX. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.transform).\n\nClassification: hybrid. Deterministic stages: table files read into real tables, SQL run on the data (SELECT only), result written by the data codecs.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":3,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 3.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"to":{"type":"string","enum":["csv","tsv","json","xlsx"],"description":"The format of the table that is made. Choose one of the listed formats.","x-davix-h2i-enum":"AiTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","instructions"]},"encoding":{"generation":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":3,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.transform","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/transform\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.transform({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->transform([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/translate":{"post":{"operationId":"ai.documents.translate","summary":"Translate documents","description":"Translate document text to a target language. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.translate).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target_language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z][A-Za-z\\-_ ()]{1,34}$","description":"The language to translate into, as a language code such as \"de\" or \"ja\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"source_language":{"type":"string","minLength":2,"maxLength":35,"description":"The language of the input, as a language code. Leave empty to detect it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"glossary":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":100,"description":"Sets the source of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target":{"type":"string","minLength":1,"maxLength":100,"description":"What the tool should aim at or work on.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["source","target"],"additionalProperties":false,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Words that must always be translated the same way: the word on the left, its translation on the right. Up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["target_language"]},"encoding":{"generation":{"contentType":"application/json"},"glossary":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":5,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.translate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/translate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'target_language=xx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.translate({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"target_language\": \"xx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->translate([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'target_language' => 'xx',\n]);\necho $result->requestId;"}]}},"/v1/ai/documents/translate-layout":{"post":{"operationId":"ai.documents.translate-layout","summary":"Translate a PDF and keep its layout","description":"Translate the text of a PDF in place: code reads the text blocks with their places, the model translates each block by id, and code covers the old text and draws the translation in the same place, as large as fits; every script works, left-to-right or right-to-left. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.translate-layout).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, token budgeting and chunking, text block extraction with positions, text fitting and wrapping, page patching and drawing.","tags":["AI","AI:documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target_language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z][A-Za-z\\-_ ()]{1,34}$","description":"The language to translate into, as a language code such as \"de\" or \"ja\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"source_language":{"type":"string","minLength":2,"maxLength":35,"description":"The language of the input, as a language code. Leave empty to detect it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"glossary":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":100,"description":"Sets the source of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target":{"type":"string","minLength":1,"maxLength":100,"description":"What the tool should aim at or work on.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["source","target"],"additionalProperties":false,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Words that must always be translated the same way: the word on the left, its translation on the right. Up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"skip_numbers":{"type":"boolean","description":"Switch on (the default) to leave text without letters (page numbers, amounts) as it is.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"min_font_size":{"type":"number","minimum":4,"maximum":14,"description":"The smallest size a translated text may be shrunk to so it still fits, from 4 to 14 points (default 6).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"dpi":{"type":"integer","minimum":100,"maximum":300,"description":"The resolution, in dots per inch, used to read or draw the pages.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"remove_original":{"type":"boolean","description":"Switch on (the default) so the old text is gone from changed pages. Off keeps the old text layer under the new one.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","target_language"]},"encoding":{"generation":{"contentType":"application/json"},"glossary":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.documents.translate-layout","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"documents"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/documents/translate-layout\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'target_language=xx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.documents.translateLayout({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"target_language\": \"xx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->documents()->translateLayout([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'target_language' => 'xx',\n]);\necho $result->requestId;"}]}},"/v1/ai/enhancement/colorize":{"post":{"operationId":"ai.enhancement.colorize","summary":"AI colorization","description":"Colorize black-and-white photos. **Currently returns 501 feature_unavailable**: No dedicated image-enhancement model is available through the provider, and general image-generation models regenerate pixels rather than faithfully enhancing them. The feature is enabled only after a model passes the fidelity benchmark.\n\nClassification: ai. Deterministic stages: upload content sniffing, input normalisation, output validation, fidelity check against the input.","tags":["AI","AI:enhancement"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.enhancement.colorize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"enhancement"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/enhancement/colorize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'strength=low' \\\n  -F 'output_format=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.enhancement.colorize({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"strength\": \"low\",\n    \"output_format\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->enhancement()->colorize([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'strength' => 'low',\n    'output_format' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/ai/enhancement/deblur":{"post":{"operationId":"ai.enhancement.deblur","summary":"AI deblurring","description":"Reduce blur. **Currently returns 501 feature_unavailable**: No dedicated image-enhancement model is available through the provider, and general image-generation models regenerate pixels rather than faithfully enhancing them. The feature is enabled only after a model passes the fidelity benchmark.\n\nClassification: ai. Deterministic stages: upload content sniffing, input normalisation, output validation, fidelity check against the input.","tags":["AI","AI:enhancement"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.enhancement.deblur","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"enhancement"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/enhancement/deblur\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'strength=low' \\\n  -F 'output_format=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.enhancement.deblur({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"strength\": \"low\",\n    \"output_format\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->enhancement()->deblur([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'strength' => 'low',\n    'output_format' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/ai/enhancement/denoise":{"post":{"operationId":"ai.enhancement.denoise","summary":"AI denoising","description":"Remove image noise. **Currently returns 501 feature_unavailable**: No dedicated image-enhancement model is available through the provider, and general image-generation models regenerate pixels rather than faithfully enhancing them. The feature is enabled only after a model passes the fidelity benchmark.\n\nClassification: ai. Deterministic stages: upload content sniffing, input normalisation, output validation, fidelity check against the input.","tags":["AI","AI:enhancement"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.enhancement.denoise","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"enhancement"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/enhancement/denoise\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'strength=low' \\\n  -F 'output_format=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.enhancement.denoise({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"strength\": \"low\",\n    \"output_format\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->enhancement()->denoise([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'strength' => 'low',\n    'output_format' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/ai/enhancement/face":{"post":{"operationId":"ai.enhancement.face","summary":"Face restoration","description":"Improve face clarity without changing identity. **Currently returns 501 feature_unavailable**: No dedicated image-enhancement model is available through the provider, and general image-generation models regenerate pixels rather than faithfully enhancing them. The feature is enabled only after a model passes the fidelity benchmark.\n\nClassification: ai. Deterministic stages: upload content sniffing, input normalisation, output validation, fidelity check against the input.","tags":["AI","AI:enhancement"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.enhancement.face","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"enhancement"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/enhancement/face\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'strength=low' \\\n  -F 'output_format=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.enhancement.face({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"strength\": \"low\",\n    \"output_format\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->enhancement()->face([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'strength' => 'low',\n    'output_format' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/ai/enhancement/restore":{"post":{"operationId":"ai.enhancement.restore","summary":"AI restoration","description":"Restore damaged/old photos. **Currently returns 501 feature_unavailable**: No dedicated image-enhancement model is available through the provider, and general image-generation models regenerate pixels rather than faithfully enhancing them. The feature is enabled only after a model passes the fidelity benchmark.\n\nClassification: ai. Deterministic stages: upload content sniffing, input normalisation, output validation, fidelity check against the input.","tags":["AI","AI:enhancement"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.enhancement.restore","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"enhancement"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/enhancement/restore\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'strength=low' \\\n  -F 'output_format=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.enhancement.restore({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"strength\": \"low\",\n    \"output_format\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->enhancement()->restore([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'strength' => 'low',\n    'output_format' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/ai/enhancement/upscale":{"post":{"operationId":"ai.enhancement.upscale","summary":"AI upscaling","description":"Increase resolution. **Currently returns 501 feature_unavailable**: No dedicated image-enhancement model is available through the provider, and general image-generation models regenerate pixels rather than faithfully enhancing them. The feature is enabled only after a model passes the fidelity benchmark.\n\nClassification: ai. Deterministic stages: upload content sniffing, input normalisation, output validation, fidelity check against the input.","tags":["AI","AI:enhancement"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"scale":{"type":"number","enum":[2,4],"description":"How much to enlarge or reduce the picture (for example 2 for double size).","x-davix-h2i-enum":"AiScale","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.enhancement.upscale","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"enhancement"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/enhancement/upscale\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'scale=2' \\\n  -F 'strength=low'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.enhancement.upscale({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"scale\": 2,\n    \"strength\": \"low\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->enhancement()->upscale([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'scale' => 2,\n    'strength' => 'low',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/bank-statement":{"post":{"operationId":"ai.extraction.bank-statement","summary":"Extract a bank statement","description":"Account, period, balances and every transaction; IBAN checksum and opening + transactions = closing balance are verified. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.bank-statement).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation, IBAN mod-97 check, balance reconciliation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.bank-statement","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/bank-statement\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.bankStatement({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->bankStatement([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/business-card":{"post":{"operationId":"ai.extraction.business-card","summary":"Extract a business card","description":"Name, title, company, e-mails, phones, websites and address; contact formats are validated. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.business-card).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.business-card","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/business-card\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.businessCard({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->businessCard([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/custom":{"post":{"operationId":"ai.extraction.custom","summary":"Extract with your own JSON Schema","description":"Structured extraction into the JSON Schema you send: the result is validated against it and reported with confidence and verified evidence quotes. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.custom).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation, JSON Schema validation (isolated, with a timeout).","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"json_schema":{"type":"string","minLength":2,"maxLength":20000,"description":"The shape the answer has to follow, written out as a schema in text form.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strict":{"type":"boolean","description":"Switch on to refuse an answer that does not follow your structure exactly.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["json_schema"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.custom","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/custom\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'json_schema=xx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.custom({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"json_schema\": \"xx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->custom([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'json_schema' => 'xx',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/expense-report":{"post":{"operationId":"ai.extraction.expense-report","summary":"Expense report","description":"Receipts and invoices become one expense report: lines with date, merchant, category and amount; code adds up the totals, the tax and the groups and compares them with a printed total. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.expense-report).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 5."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"currency":{"type":"string","minLength":3,"maxLength":3,"pattern":"^[A-Za-z]{3}$","description":"The currency to use for prices and amounts.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"categories":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","minLength":1,"maxLength":40,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"The expense categories to sort the items into, for example travel, meals, lodging. One per line, up to 20. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"purpose":{"type":"string","maxLength":200,"description":"What the expenses were for, for example \"Berlin client visit\". It is written on the report.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"group_by":{"type":"string","enum":["category","date","merchant","none"],"description":"How the items are grouped in the report: by category, by date, by merchant, or not at all.","x-davix-h2i-enum":"AiGroupBy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"include_tax":{"type":"boolean","description":"Switch on to show the tax of each item and the total tax.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"},"categories":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":0,"ceiling":5,"directFiles":5,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.extraction.expense-report","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/expense-report\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.expenseReport({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->expenseReport([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/id-document":{"post":{"operationId":"ai.extraction.id-document","summary":"Extract an ID document","description":"Passport / ID card / driving licence fields; the machine readable zone is verified with its ICAO 9303 check digits. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.id-document).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation, MRZ check-digit verification (ICAO 9303).","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.id-document","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/id-document\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.idDocument({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->idDocument([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/invoice":{"post":{"operationId":"ai.extraction.invoice","summary":"Extract an invoice","description":"Vendor, customer, dates, line items and totals; arithmetic-checked and evidence-grounded. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.invoice).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.invoice","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/invoice\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.invoice({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->invoice([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/payslip":{"post":{"operationId":"ai.extraction.payslip","summary":"Extract a payslip","description":"Employer, employee, pay period, earnings, deductions, gross and net pay; earnings, deductions and net are re-added and checked. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.payslip).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.payslip","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/payslip\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.payslip({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->payslip([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/purchase-order":{"post":{"operationId":"ai.extraction.purchase-order","summary":"Extract a purchase order","description":"PO number, dates, buyer, supplier, ship-to and line items; arithmetic-checked and evidence-grounded. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.purchase-order).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.purchase-order","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/purchase-order\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.purchaseOrder({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->purchaseOrder([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/receipt":{"post":{"operationId":"ai.extraction.receipt","summary":"Extract a receipt","description":"Merchant, items, totals and payment; arithmetic-checked and evidence-grounded. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.receipt).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.receipt","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/receipt\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.receipt({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->receipt([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/resume":{"post":{"operationId":"ai.extraction.resume","summary":"Extract a resume/CV","description":"Contact, experience, education and skills; format-validated and evidence-grounded. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.resume).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.resume","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/resume\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.resume({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->resume([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/shipping-label":{"post":{"operationId":"ai.extraction.shipping-label","summary":"Extract a shipping label","description":"Carrier, service, tracking numbers, sender, recipient, weight and reference; tracking-number formats and UPS check digits are verified. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.shipping-label).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.shipping-label","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/shipping-label\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.shippingLabel({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->shippingLabel([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/tax-form":{"post":{"operationId":"ai.extraction.tax-form","summary":"Extract a tax form","description":"Form type, year, recipient, payer and every box (W-2, 1099, P60 and similar); tax identifiers are masked to their last 4 characters unless you turn that off. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.tax-form).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"mask_ids":{"type":"boolean","description":"Switch on (the default) to show only the last 4 characters of tax numbers.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.tax-form","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/tax-form\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.taxForm({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->taxForm([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/extraction/utility-bill":{"post":{"operationId":"ai.extraction.utility-bill","summary":"Extract a utility bill","description":"Provider, account, meter, billing period, usage, charges and amount due; readings, charges and the balance are re-added and checked. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.utility-bill).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation.","tags":["AI","AI:extraction"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.extraction.utility-bill","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"extraction"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/extraction/utility-bill\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.extraction.utilityBill({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->extraction()->utilityBill([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/generate":{"post":{"operationId":"ai.generate","summary":"Generate (image)","description":"Generic prompt-to-image (or image-to-image) generation with automatic or explicit model. Readiness: unbenchmarked (see GET /v1/ai/capabilities/core.generate).\n\nClassification: ai. Deterministic stages: generated image validation and re-encoding.","tags":["AI","AI:core"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"n":{"type":"integer","minimum":1,"maximum":10,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3","21:9"],"description":"The shape of the picture, for example 1:1, 4:3 or 16:9.","x-davix-h2i-enum":"AiAspectRatio","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"size":{"type":"string","enum":["512","1K","2K"],"description":"The resolution of the picture: 512, 1K or 2K. Larger takes longer and costs more.","x-davix-h2i-enum":"AiSize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"negative_prompt":{"type":"string","maxLength":500,"description":"Things the picture must not contain, in words, for example \"text, watermark, extra fingers\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","maxLength":120,"description":"The look of the picture in words, for example \"watercolor\" or \"photo, soft light\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["instructions"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"core"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'n=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generate({\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"n\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generate([\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'n' => 1,\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/background":{"post":{"operationId":"ai.generation.background","summary":"Background generation","description":"Generate a background scene, or a new background around a supplied subject image. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.background).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"n":{"type":"integer","minimum":1,"maximum":10,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3","21:9"],"description":"The shape of the picture, for example 1:1, 4:3 or 16:9.","x-davix-h2i-enum":"AiAspectRatio","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"size":{"type":"string","enum":["512","1K","2K"],"description":"The resolution of the picture: 512, 1K or 2K. Larger takes longer and costs more.","x-davix-h2i-enum":"AiSize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"keep_subject":{"type":"boolean","description":"On (the default): the subject stays exactly as it is, only the background changes. Off lets the AI adapt the light and colours of the subject so it blends into the new background.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","maxLength":120,"description":"The look of the new background in words, for example \"soft bokeh\" or \"studio grey\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["instructions"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.background","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/background\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'n=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.background({\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"n\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->background([\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'n' => 1,\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/edit":{"post":{"operationId":"ai.generation.edit","summary":"AI image editing","description":"Edit, replace background, remove/replace objects, generative fill. An optional region keeps all pixels outside it byte-identical. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.edit).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output, region-locked compositing (pixels outside the region are restored from the original).","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"mode":{"type":"string","enum":["edit","replace-background","remove-object","replace-object","generative-fill"],"description":"The working mode of the tool; the allowed values are listed with the parameter.","x-davix-h2i-enum":"AiGenerationEditMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target":{"type":"string","maxLength":300,"description":"What to change, in words, for example \"the red car\". Your instructions work too.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"region":{"type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1,"description":"Sets the x of the result. A number from 0 up to 1.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"y":{"type":"number","minimum":0,"maximum":1,"description":"Sets the y of the result. A number from 0 up to 1.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"width":{"type":"number","minimum":0,"maximum":1,"description":"Width of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"height":{"type":"number","minimum":0,"maximum":1,"description":"Height of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["x","y","width","height"],"additionalProperties":false,"description":"The box that may be changed, written as fractions of the picture from 0 to 1: where it starts (x, y) and its width and height. For example x 0.25, y 0.25, width 0.5, height 0.5 is the middle half. Every pixel outside the box stays exactly as it was. Leave empty to change the whole picture. (JSON-encoded object)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","instructions"]},"encoding":{"region":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.edit","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/edit\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'mode=edit'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.edit({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"mode\": \"edit\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->edit([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'mode' => 'edit',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/erase":{"post":{"operationId":"ai.generation.erase","summary":"AI object eraser","description":"Remove an object (and its shadow) and fill the gap so it looks as if it was never there. An optional region keeps all pixels outside it byte-identical. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.erase).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output, region-locked compositing (pixels outside the region are restored from the original).","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"target":{"type":"string","maxLength":300,"description":"What to erase, in words, for example \"the person on the left\". Your instructions work too.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"region":{"type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1,"description":"Sets the x of the result. A number from 0 up to 1.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"y":{"type":"number","minimum":0,"maximum":1,"description":"Sets the y of the result. A number from 0 up to 1.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"width":{"type":"number","minimum":0,"maximum":1,"description":"Width of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"height":{"type":"number","minimum":0,"maximum":1,"description":"Height of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["x","y","width","height"],"additionalProperties":false,"description":"The box to clear, written as fractions of the picture from 0 to 1: where it starts (x, y) and its width and height. Every pixel outside the box stays exactly as it was. Leave empty to describe what to erase in words instead. (JSON-encoded object)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"fill":{"type":"string","enum":["natural","plain"],"description":"What replaces the erased part: natural continues the surroundings, plain is one flat colour taken from them.","x-davix-h2i-enum":"AiFill","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"remove_shadows":{"type":"boolean","description":"Switch on (the default) to also remove the shadow and reflection of the erased thing.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"region":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.erase","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/erase\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'fill=natural' \\\n  -F 'n=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.erase({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"fill\": \"natural\",\n    \"n\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->erase([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'fill' => 'natural',\n    'n' => 1,\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/expand":{"post":{"operationId":"ai.generation.expand","summary":"Outpainting / image expansion","description":"Extend an image; the original pixels are restored exactly after generation. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.expand).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output, canvas extension, original-region restoration.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"top":{"type":"integer","minimum":0,"maximum":2048,"description":"How many pixels to add above the picture (0 to 2048).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"right":{"type":"integer","minimum":0,"maximum":2048,"description":"How many pixels to add to the right of the picture (0 to 2048).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"bottom":{"type":"integer","minimum":0,"maximum":2048,"description":"How many pixels to add below the picture (0 to 2048).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"left":{"type":"integer","minimum":0,"maximum":2048,"description":"How many pixels to add to the left of the picture (0 to 2048).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target_aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3","21:9"],"description":"Expand the picture until it has this shape, for example 16:9. Use it instead of the four sides above.","x-davix-h2i-enum":"AiTargetAspectRatio","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.expand","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/expand\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'top=0' \\\n  -F 'right=0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.expand({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"top\": 0,\n    \"right\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->expand([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'top' => 0,\n    'right' => 0,\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/generate":{"post":{"operationId":"ai.generation.generate","summary":"Text to image","description":"Generate images from a prompt; also image-to-image when a reference image is supplied. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.generate).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"n":{"type":"integer","minimum":1,"maximum":10,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3","21:9"],"description":"The shape of the picture, for example 1:1, 4:3 or 16:9.","x-davix-h2i-enum":"AiAspectRatio","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"size":{"type":"string","enum":["512","1K","2K"],"description":"The resolution of the picture: 512, 1K or 2K. Larger takes longer and costs more.","x-davix-h2i-enum":"AiSize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"negative_prompt":{"type":"string","maxLength":500,"description":"Things the picture must not contain, in words, for example \"text, watermark, extra fingers\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","maxLength":120,"description":"The look of the picture in words, for example \"watercolor\" or \"photo, soft light\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["instructions"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.generate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/generate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'instructions=example' \\\n  -F 'n=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.generate({\n    \"on_unsupported\": \"error\",\n    \"instructions\": \"example\",\n    \"n\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->generate([\n    'on_unsupported' => 'error',\n    'instructions' => 'example',\n    'n' => 1,\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/logo":{"post":{"operationId":"ai.generation.logo","summary":"AI logo maker","description":"The model draws the symbol; the name, tagline, layout, colours and background are set as exact text and shapes, on a transparent background if you like. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.logo).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output, white-to-transparent conversion of the symbol, deterministic name and tagline typography, layout and background composition.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the brand, written in the logo.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tagline":{"type":"string","maxLength":100,"description":"A short line of text that goes with the name.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","enum":["minimal","modern","playful","elegant","bold","vintage","tech","organic"],"description":"The style of the logo: minimal, modern, playful, elegant, bold, vintage, tech or organic.","x-davix-h2i-enum":"AiGenerationLogoStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"colors":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Up to 3 colours for the logo, as colour names or hex values. One per line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"symbol":{"type":"string","maxLength":200,"description":"The symbol or idea of the logo, in words, for example \"a mountain\" or \"a leaf\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"layout":{"type":"string","enum":["stacked","horizontal","mark-only"],"description":"How the logo is arranged: stacked (symbol above the name), horizontal (side by side) or mark-only (no name).","x-davix-h2i-enum":"AiLayout","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"background":{"type":"string","enum":["transparent","white","black","color"],"description":"The background to use behind the subject.","x-davix-h2i-enum":"AiGenerationLogoBackground","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"background_color":{"type":"string","format":"color","description":"The background colour, as a colour name or a hex value such as #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"text_color":{"type":"string","format":"color","description":"The colour of the text, as a colour name or a hex value such as #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"font":{"type":"string","enum":["sans","serif","mono","rounded"],"description":"The style of the lettering: sans, serif, mono or rounded.","x-davix-h2i-enum":"AiFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"width":{"type":"integer","minimum":256,"maximum":2048,"description":"Width of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["name"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.generation.logo","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/logo\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"on_unsupported\":\"error\",\"name\":\"x\",\"style\":\"minimal\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.logo({\n    \"on_unsupported\": \"error\",\n    \"name\": \"x\",\n    \"style\": \"minimal\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->logo([\n    'on_unsupported' => 'error',\n    'name' => 'x',\n    'style' => 'minimal',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/portrait":{"post":{"operationId":"ai.generation.portrait","summary":"Portrait styles","description":"Restyle a portrait photo: professional headshot, LinkedIn, passport-style, studio, cinematic, painting, anime and more, keeping the person recognisable; background, outfit and framing are options. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.portrait).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","enum":["professional-headshot","linkedin","passport-style","studio","cinematic","oil-painting","watercolor","anime","cartoon","pencil-sketch","vintage","custom"],"description":"The kind of portrait to make, for example a professional headshot, LinkedIn photo, studio, oil painting or anime. Choose custom to describe your own.","x-davix-h2i-enum":"AiGenerationPortraitStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"custom_style":{"type":"string","maxLength":200,"description":"Your own style for the portrait, in words. Used when you want something that the list of styles does not have.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"background":{"type":"string","enum":["keep","neutral","office","outdoor","studio-gray","white","custom"],"description":"The background to use behind the subject.","x-davix-h2i-enum":"AiGenerationPortraitBackground","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"background_note":{"type":"string","maxLength":150,"description":"What the background should look like, in words, for example \"a bright office\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"outfit":{"type":"string","maxLength":120,"description":"What the person wears, in words, for example \"a dark suit\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"likeness":{"type":"string","enum":["high","medium"],"description":"How closely the portrait must look like the person: high or medium.","x-davix-h2i-enum":"AiLikeness","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"crop":{"type":"string","enum":["head-shoulders","bust","full"],"description":"How much of the person is shown: head and shoulders, bust, or full length.","x-davix-h2i-enum":"AiCrop","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.portrait","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/portrait\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'n=1' \\\n  -F 'output_format=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.portrait({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"n\": 1,\n    \"output_format\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->portrait([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'n' => 1,\n    'output_format' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/poster":{"post":{"operationId":"ai.generation.poster","summary":"Poster / banner generation","description":"AI artwork plus deterministic title/detail typography at poster dimensions. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.poster).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output, deterministic text rendering (SVG), paper size presets.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"title":{"type":"string","minLength":1,"maxLength":120,"description":"The big title on the poster.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"subtitle":{"type":"string","maxLength":200,"description":"A second, smaller line under the title.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"details":{"type":"array","maxItems":6,"items":{"type":"string","maxLength":120,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Up to 6 lines of detail, such as the date, place or price. One per line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"size":{"type":"string","enum":["a4","a3","letter","tabloid","custom"],"description":"The paper size of the poster: a4, a3, letter, tabloid, or custom for your own width and height.","x-davix-h2i-enum":"AiGenerationPosterSize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"width":{"type":"integer","minimum":256,"maximum":4096,"description":"Width of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"height":{"type":"integer","minimum":256,"maximum":4096,"description":"Height of the result in pixels.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"portrait (tall) or landscape (wide).","x-davix-h2i-enum":"Orientation2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"text_color":{"type":"string","format":"color","description":"The colour of the text, as a colour name or a hex value such as #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["title"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.generation.poster","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/poster\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"on_unsupported\":\"error\",\"title\":\"x\",\"size\":\"a4\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.poster({\n    \"on_unsupported\": \"error\",\n    \"title\": \"x\",\n    \"size\": \"a4\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->poster([\n    'on_unsupported' => 'error',\n    'title' => 'x',\n    'size' => 'a4',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/product":{"post":{"operationId":"ai.generation.product","summary":"AI product photography","description":"Place a product photo in a studio/lifestyle scene. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.product).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"n":{"type":"integer","minimum":1,"maximum":10,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3","21:9"],"description":"The shape of the picture, for example 1:1, 4:3 or 16:9.","x-davix-h2i-enum":"AiAspectRatio","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"size":{"type":"string","enum":["512","1K","2K"],"description":"The resolution of the picture: 512, 1K or 2K. Larger takes longer and costs more.","x-davix-h2i-enum":"AiSize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"scene":{"type":"string","maxLength":300,"description":"The setting to place the product in, in words, for example \"on a wooden table near a window\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"background":{"type":"string","enum":["studio-white","gradient","lifestyle","custom"],"description":"The background to use behind the subject.","x-davix-h2i-enum":"AiGenerationProductBackground","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.product","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/product\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'n=1' \\\n  -F 'aspect_ratio=1:1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.product({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"n\": 1,\n    \"aspect_ratio\": \"1:1\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->product([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'n' => 1,\n    'aspect_ratio' => '1:1',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/remove-background":{"post":{"operationId":"ai.generation.remove-background","summary":"AI background removal","description":"Cut the subject out of a picture with an AI model. The model decides what the subject is; its answer becomes a mask that is applied to YOUR original pixels, so the subject comes out unchanged on a transparent background (or as a mask, or on a colour). Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.remove-background).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output, key-colour choice (furthest from the subject), mask from the model answer, subject fidelity check against the input, mask applied to the original pixels, full-resolution output.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"output":{"type":"string","enum":["cutout","mask"],"description":"cutout gives the subject on a transparent background; mask gives a black and white mask.","x-davix-h2i-enum":"AiGenerationRemoveBackgroundOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tolerance":{"type":"number","minimum":1,"maximum":100,"description":"How different from the background colour a pixel must be to stay, from 1 to 100. Higher removes more.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"feather":{"type":"number","minimum":0,"maximum":20,"description":"How soft the edge of the cutout is, from 0 to 20. Higher is softer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"shrink":{"type":"integer","minimum":0,"maximum":10,"description":"Pulls the edge of the cutout in by this many pixels (0 to 10) to remove a thin halo.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"background_color":{"type":"string","format":"color","description":"The background colour, as a colour name or a hex value such as #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"trim":{"type":"boolean","description":"Switch on to cut the result down to the subject, removing the empty border.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.remove-background","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/remove-background\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'output=cutout' \\\n  -F 'tolerance=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.removeBackground({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"output\": \"cutout\",\n    \"tolerance\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->removeBackground([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'output' => 'cutout',\n    'tolerance' => 1,\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/sketch":{"post":{"operationId":"ai.generation.sketch","summary":"Sketch to image / room redesign / try-on","description":"Finish a sketch, redesign a room photo in a style, or show a person wearing a garment from a second picture. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.sketch).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":2,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 2."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"mode":{"type":"string","enum":["sketch","room","try-on"],"description":"The working mode of the tool; the allowed values are listed with the parameter.","x-davix-h2i-enum":"AiGenerationSketchMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"style":{"type":"string","maxLength":150,"description":"The look the finished picture should have, in words, for example \"realistic\" or \"watercolor\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"keep_layout":{"type":"boolean","description":"Switch on to keep the lines and layout of the sketch and only add detail and colour.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"room_type":{"type":"string","maxLength":60,"description":"For an interior sketch: the kind of room, for example kitchen or bedroom.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"palette":{"type":"array","maxItems":6,"items":{"type":"string","minLength":1,"maxLength":30,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Up to 6 colours to use. One per line, as colour names or hex values. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"garment_note":{"type":"string","maxLength":150,"description":"For a clothing sketch: the fabric or details, in words, for example \"linen, light blue\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"palette":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":2,"directFiles":2,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.generation.sketch","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/sketch\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'n=1' \\\n  -F 'output_format=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.sketch({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"n\": 1,\n    \"output_format\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->sketch([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'n' => 1,\n    'output_format' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/social":{"post":{"operationId":"ai.generation.social","summary":"Social media image","description":"AI background plus deterministic text composition at platform dimensions. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.social).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output, deterministic text rendering (SVG), platform size presets.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"platform":{"type":"string","enum":["instagram-square","instagram-story","twitter","facebook","linkedin","pinterest"],"description":"The platform the text is written for, so length and style follow its customs.","x-davix-h2i-enum":"AiGenerationSocialPlatform","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"headline":{"type":"string","maxLength":120,"description":"The main line of text on the picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"subheadline":{"type":"string","maxLength":160,"description":"A second, smaller line of text on the picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"text_position":{"type":"string","enum":["top","center","bottom"],"description":"Where the text is placed on the picture.","x-davix-h2i-enum":"AiTextPosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"text_color":{"type":"string","format":"color","description":"The colour of the text, as a colour name or a hex value such as #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.generation.social","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/social\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"on_unsupported\":\"error\",\"platform\":\"instagram-square\",\"text_position\":\"top\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.social({\n    \"on_unsupported\": \"error\",\n    \"platform\": \"instagram-square\",\n    \"text_position\": \"top\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->social([\n    'on_unsupported' => 'error',\n    'platform' => 'instagram-square',\n    'text_position' => 'top',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/style":{"post":{"operationId":"ai.generation.style","summary":"AI style transfer","description":"Restyle a picture after a second picture, or after a description, with a strength and a choice of what to keep (structure, colours or subject). Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.style).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":2,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 2."},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"style":{"type":"string","maxLength":300,"description":"The style to turn the picture into, in words, for example \"Van Gogh\" or \"pencil drawing\". Needed when you send no second picture as an example.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"preserve":{"type":"string","enum":["structure","colors","subject","none"],"description":"What must stay the same in the restyled picture: structure, colors, subject, or none.","x-davix-h2i-enum":"AiPreserve","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":2,"directFiles":2,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"ai.generation.style","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/style\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'strength=low' \\\n  -F 'preserve=structure'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.style({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"strength\": \"low\",\n    \"preserve\": \"structure\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->style([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'strength' => 'low',\n    'preserve' => 'structure',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/thumbnail":{"post":{"operationId":"ai.generation.thumbnail","summary":"Thumbnail generation","description":"AI background plus deterministic text composition (exact typography). Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.thumbnail).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output, deterministic text rendering (SVG), platform size presets.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"title":{"type":"string","minLength":1,"maxLength":120,"description":"The title written on the thumbnail. Keep it short.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"subtitle":{"type":"string","maxLength":160,"description":"A second, smaller line of text on the thumbnail.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"platform":{"type":"string","enum":["youtube","blog","generic"],"description":"The platform the text is written for, so length and style follow its customs.","x-davix-h2i-enum":"AiGenerationThumbnailPlatform","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"text_position":{"type":"string","enum":["top","center","bottom"],"description":"Where the text is placed on the picture.","x-davix-h2i-enum":"AiTextPosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"text_color":{"type":"string","format":"color","description":"The colour of the text, as a colour name or a hex value such as #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"n":{"type":"integer","minimum":1,"maximum":4,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["title"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.generation.thumbnail","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/thumbnail\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"on_unsupported\":\"error\",\"title\":\"x\",\"platform\":\"youtube\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.thumbnail({\n    \"on_unsupported\": \"error\",\n    \"title\": \"x\",\n    \"platform\": \"youtube\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->thumbnail([\n    'on_unsupported' => 'error',\n    'title' => 'x',\n    'platform' => 'youtube',\n]);\necho $result->requestId;"}]}},"/v1/ai/generation/variations":{"post":{"operationId":"ai.generation.variations","summary":"Image variations","description":"Create variations of an image. Readiness: unbenchmarked (see GET /v1/ai/capabilities/generation.variations).\n\nClassification: ai. Deterministic stages: upload content sniffing, input image normalisation, generated image validation and re-encoding, signed-URL output.","tags":["AI","AI:generation"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"n":{"type":"integer","minimum":1,"maximum":10,"description":"How many results (images or versions) to make.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3","21:9"],"description":"The shape of the picture, for example 1:1, 4:3 or 16:9.","x-davix-h2i-enum":"AiAspectRatio","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"size":{"type":"string","enum":["512","1K","2K"],"description":"The resolution of the pictures: 512, 1K or 2K. Larger takes longer and costs more.","x-davix-h2i-enum":"AiSize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"The file type of the picture: png, jpeg or webp (the allowed values are listed with the parameter).","x-davix-h2i-enum":"AiOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strength":{"type":"string","enum":["low","medium","high"],"description":"How strong the change is, from subtle to strong.","x-davix-h2i-enum":"AiStrength","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that asks the model to repeat a result: the same seed with the same request tends to give the same image. Only models that advertise a seed parameter take it. With on_unsupported=error (the default) a model without it is refused, or skipped when the model is chosen automatically; with on_unsupported=ignore the request runs and a warning says the seed was not applied. Providers do not guarantee identical images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number, negative or above 2147483647 -> 400 ai_input_invalid.","evidence":"src/api/ai/services/generation/generation.service.js:imageGenerationParams"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.generation.variations","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"generation"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/generation/variations\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'n=1' \\\n  -F 'aspect_ratio=1:1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.generation.variations({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"n\": 1,\n    \"aspect_ratio\": \"1:1\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->generation()->variations([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'n' => 1,\n    'aspect_ratio' => '1:1',\n]);\necho $result->requestId;"}]}},"/v1/ai/images/caption":{"post":{"operationId":"ai.images.caption","summary":"Caption an image","description":"One-sentence caption. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.caption).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped).","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_length":{"type":"integer","minimum":20,"maximum":500,"description":"The longest answer wanted, so the result stays within this size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"tone":{"type":"string","enum":["neutral","friendly","professional","playful"],"description":"The tone of the text, for example formal, friendly or neutral.","x-davix-h2i-enum":"AiImagesCaptionTone","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.caption","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/caption\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'max_length=20'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.caption({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"max_length\": 20\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->caption([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'max_length' => 20,\n]);\necho $result->requestId;"}]}},"/v1/ai/images/classify":{"post":{"operationId":"ai.images.classify","summary":"Classify an image","description":"Label from your list or a generic category. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.classify).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped).","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"labels":{"type":"array","minItems":2,"maxItems":50,"items":{"type":"string","minLength":1,"maxLength":80,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"The categories to choose from. One per line, up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"},"labels":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.classify","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/classify\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'model=auto' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.classify({\n    \"files\": 'document.pdf',\n    \"model\": \"auto\",\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->classify([\n    'files' => 'document.pdf',\n    'model' => 'auto',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/images/describe":{"post":{"operationId":"ai.images.describe","summary":"Describe an image","description":"Description with subjects, setting, colours, mood and details. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.describe).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped).","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"detail":{"type":"string","enum":["brief","standard","detailed"],"description":"How much to say about the picture: brief, standard or detailed.","x-davix-h2i-enum":"AiImagesDescribeDetail","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.describe","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/describe\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'detail=brief'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.describe({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"detail\": \"brief\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->describe([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'detail' => 'brief',\n]);\necho $result->requestId;"}]}},"/v1/ai/images/extract":{"post":{"operationId":"ai.images.extract","summary":"Image to JSON","description":"Extract requested fields/entities/dates/amounts/addresses from an image. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.extract).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped), ISO date / currency validation.","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"fields":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_ .\\-]*$","description":"Sets the name of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"type":{"type":"string","enum":["string","number","date","currency","boolean","list"],"default":"string","description":"The kind of result to produce.","x-davix-h2i-enum":"AiType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":{"type":"string","maxLength":300,"description":"Sets the description of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["name","type"],"additionalProperties":false,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"The values to find in the picture: a name, a type and a short description for each. Up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"include":{"type":"array","maxItems":4,"items":{"type":"string","enum":["entities","dates","amounts","addresses"],"description":"Sets the item of the result. Choose one of the allowed values listed with the parameter.","x-davix-h2i-enum":"AiIncludeItem","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Also collect these kinds of values: entities, dates, amounts or addresses. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"},"fields":{"contentType":"application/json"},"include":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.extract","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/extract\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'model=auto' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.extract({\n    \"files\": 'document.pdf',\n    \"model\": \"auto\",\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->extract([\n    'files' => 'document.pdf',\n    'model' => 'auto',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/images/font":{"post":{"operationId":"ai.images.font","summary":"Identify a font","description":"The closest known fonts for the lettering in a picture, with what matches and a free alternative; these are estimates, never a certain match. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.font).\n\nClassification: ai. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_candidates":{"type":"integer","minimum":1,"maximum":10,"description":"The largest number of candidate results to return.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"prefer":{"type":"string","enum":["any","free","system"],"description":"What kind of fonts to suggest: any, free ones only, or ones already on most computers (system).","x-davix-h2i-enum":"AiPrefer","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"category":{"type":"string","enum":["any","serif","sans-serif","monospace","display","handwriting"],"description":"Only suggest fonts of this kind: serif, sans-serif, monospace, display or handwriting. any suggests all.","x-davix-h2i-enum":"AiCategory","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.font","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/font\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'max_candidates=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.font({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"max_candidates\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->font([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'max_candidates' => 1,\n]);\necho $result->requestId;"}]}},"/v1/ai/images/moderate":{"post":{"operationId":"ai.images.moderate","summary":"Moderate an image","description":"Per-category content-safety flags with confidence and an overall verdict. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.moderate).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped).","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"categories":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string","enum":["sexual","nudity","violence","graphic_injury","hate_symbols","self_harm","weapons","drugs","minors_risk","spam_or_scam"],"description":"Sets the item of the result. Choose one of the allowed values listed with the parameter.","x-davix-h2i-enum":"AiCategoriesItem","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Only check for these kinds of content. Empty checks all of them. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strictness":{"type":"string","enum":["low","medium","high"],"description":"How strict the check is: low, medium or high.","x-davix-h2i-enum":"AiImagesModerateStrictness","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"},"categories":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.moderate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/moderate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strictness=low'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.moderate({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strictness\": \"low\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->moderate([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strictness' => 'low',\n]);\necho $result->requestId;"}]}},"/v1/ai/images/objects":{"post":{"operationId":"ai.images.objects","summary":"Identify objects","description":"Objects with counts and coarse positions (no coordinates/boxes). Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.objects).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped).","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max":{"type":"integer","minimum":1,"maximum":100,"description":"The largest number of results to return.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.objects","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/objects\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'max=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.objects({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"max\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->objects([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'max' => 1,\n]);\necho $result->requestId;"}]}},"/v1/ai/images/prompt":{"post":{"operationId":"ai.images.prompt","summary":"Image to prompt","description":"A prompt that would recreate a picture, written for Midjourney, Stable Diffusion, DALL-E, Flux or any model, with a negative prompt and variants; code enforces the word limit. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.prompt).\n\nClassification: ai. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target":{"type":"string","enum":["generic","midjourney","stable-diffusion","dall-e","flux"],"description":"The program the prompt is written for: generic, Midjourney, Stable Diffusion, DALL-E or Flux. Each likes a different way of writing.","x-davix-h2i-enum":"AiImagesPromptTarget","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"detail":{"type":"string","enum":["short","medium","long"],"description":"How long the written prompt is: short, medium or long.","x-davix-h2i-enum":"AiImagesPromptDetail","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"variants":{"type":"integer","minimum":0,"maximum":3,"description":"How many different prompts to write, so you can try several.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"negative":{"type":"boolean","description":"Switch on to also write a list of things the picture should not contain.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"include_style":{"type":"boolean","description":"Switch on to add the visual style of the picture (light, camera, medium) to the prompt.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max_words":{"type":"integer","minimum":10,"maximum":300,"description":"The largest number of words in the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.prompt","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/prompt\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'target=generic'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.prompt({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"target\": \"generic\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->prompt([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'target' => 'generic',\n]);\necho $result->requestId;"}]}},"/v1/ai/images/qa":{"post":{"operationId":"ai.images.qa","summary":"Visual question answering","description":"Answer a question about an image. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.qa).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped).","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"question":{"type":"string","description":"The question to answer."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"answer_style":{"type":"string","enum":["concise","detailed"],"description":"How the answer is written: short, detailed or step by step as the allowed values say.","x-davix-h2i-enum":"AiAnswerStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","question"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.qa","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/qa\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'question=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.qa({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"question\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->qa([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'question' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/images/scene":{"post":{"operationId":"ai.images.scene","summary":"Understand a scene","description":"Scene type, setting, activities, mood and notable elements. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.scene).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped).","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.scene","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/scene\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'model=auto' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.scene({\n    \"files\": 'document.pdf',\n    \"model\": \"auto\",\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->scene([\n    'files' => 'document.pdf',\n    'model' => 'auto',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/images/tags":{"post":{"operationId":"ai.images.tags","summary":"Tag an image","description":"Ranked descriptive tags. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.tags).\n\nClassification: ai. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped).","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"max":{"type":"integer","minimum":1,"maximum":50,"description":"The largest number of results to return.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.tags","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/tags\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'max=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.tags({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"max\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->tags([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'max' => 1,\n]);\necho $result->requestId;"}]}},"/v1/ai/images/translate":{"post":{"operationId":"ai.images.translate","summary":"Translate text in an image","description":"Reads the text in an image (OCR plus vision) and translates it, block by block. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.translate).\n\nClassification: hybrid. Deterministic stages: upload content sniffing, image normalisation (EXIF orientation, resize, metadata stripped), OCR as a reading aid.","tags":["AI","AI:images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target_language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z][A-Za-z\\-_ ()]{1,34}$","description":"The language to translate into, as a language code such as \"de\" or \"ja\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"source_language":{"type":"string","minLength":2,"maxLength":35,"description":"The language of the input, as a language code. Leave empty to detect it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","target_language"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.images.translate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"images"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/images/translate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'target_language=xx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.images.translate({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"target_language\": \"xx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->images()->translate([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'target_language' => 'xx',\n]);\necho $result->requestId;"}]}},"/v1/ai/models":{"get":{"operationId":"ai.models","summary":"List models","description":"Normalised, dynamically discovered model catalogue with capability filters.\n\nClassification: deterministic. Deterministic stages: none.","tags":["AI","AI:models"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"input_modality","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Each item must be one of text, image, file, video, audio; more than 10 items -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/models/query.schema.js (Zod strict query)"}},"description":"Comma-separated list (max 10): text,image,file,video,audio"},{"name":"output_modality","in":"query","required":false,"schema":{"type":"string","enum":["text","image","audio"],"x-davix-h2i-enum":"AiOutputModality","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Unknown value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/models/query.schema.js (Zod strict query)"}}},{"name":"supports","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z_]{2,40}$","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Each item must match the pattern; more than 10 items -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/models/query.schema.js (Zod strict query)"}},"description":"Comma-separated supported_parameters (max 10), e.g. \"structured_outputs,seed\""},{"name":"structured_output","in":"query","required":false,"schema":{"type":"boolean","x-davix-h2i-behavior":{"onInvalid":"normalize","note":"\"1\", \"true\" or \"yes\" (any case) = true; any other value = false.","evidence":"src/api/ai/schemas/models/query.schema.js:boolQ"}}},{"name":"task","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]+\\.[a-z\\-]+$","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Must look like \"family.task\" -> otherwise 400 ai_input_invalid.","evidence":"src/api/ai/schemas/models/query.schema.js (Zod strict query)"}},"description":"Filter to models eligible for this task id."},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80,"x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Longer than 80 characters -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/models/query.schema.js (Zod strict query)"}}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100,"x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Absent or empty -> 100. Non-numeric or outside 1-500 -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/models/query.schema.js:intQ"}}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000,"default":0,"x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Absent or empty -> 0. Non-numeric or outside 0-100000 -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/models/query.schema.js:intQ"}}}],"responses":{"200":{"description":"A discovery document (not the AI response envelope).","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"},"catalog":{"$ref":"#/components/schemas/AiCatalogStatus"},"models":{"type":"array","items":{"$ref":"#/components/schemas/AiModel"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["total","offset","limit","catalog","models"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.models","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":false,"studioReachable":true,"demoVisible":true,"group":"models"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/ai/models?output_modality=text&limit=100&offset=0\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.models.list({\n    \"output_modality\": \"text\",\n    \"limit\": 100,\n    \"offset\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->models()->list([\n    'output_modality' => 'text',\n    'limit' => 100,\n    'offset' => 0,\n]);\necho $result->requestId;"}]}},"/v1/ai/models/{model}":{"get":{"operationId":"ai.models._model_","summary":"Model detail","description":"Normalised metadata, supported parameters and (optionally) provider endpoints for one model.\n\nClassification: deterministic. Deterministic stages: none.","tags":["AI","AI:models"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"},"description":"A model id, percent-encoded (it may contain \"/\")."},{"name":"include","in":"query","required":false,"schema":{"type":"string","enum":["endpoints"],"x-davix-h2i-enum":"AiInclude","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Any value other than \"endpoints\" -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/models/query.schema.js (Zod strict query)"}}}],"responses":{"200":{"description":"A discovery document (not the AI response envelope).","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AiModel"}],"type":"object","properties":{"endpoints":{"type":"array","items":{"type":"object"},"description":"Only with include=endpoints: the provider endpoints serving this model (name, provider, tag, quantization, contextLength, maxCompletionTokens, supportedParameters, supportsImageReference, status, uptime5m/30m/1d, latency30m, throughput30m, pricing)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"ai.models.{model}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":false,"studioReachable":true,"demoVisible":true,"group":"models"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/ai/models/example?include=endpoints\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.models.get({\n    \"model\": \"example\",\n    \"include\": \"endpoints\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->models()->get([\n    'model' => 'example',\n    'include' => 'endpoints',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/chart":{"post":{"operationId":"ai.ocr.chart","summary":"Chart understanding","description":"Chart type, axes, series and insights (values are estimates unless printed). Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.chart).\n\nClassification: ai. Deterministic stages: image normalisation.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.chart","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/chart\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.chart({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->chart([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/correct":{"post":{"operationId":"ai.ocr.correct","summary":"OCR correction","description":"Fix recognition errors in OCR text (from an image/PDF or supplied text); returns a deterministic diff. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.correct).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR with per-page confidence, word-level diff of original vs corrected.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"deskew":{"type":"boolean","description":"Straighten a page that was scanned at a slight angle before reading it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"denoise":{"type":"boolean","description":"Remove scanner noise and specks before reading the page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"mode":{"type":"string","enum":["grammar","spelling","both"],"description":"The working mode of the tool; the allowed values are listed with the parameter.","x-davix-h2i-enum":"AiMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.correct","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/correct\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.correct({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->correct([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/detect-language":{"post":{"operationId":"ai.ocr.detect-language","summary":"Detect the language of an image or scan","description":"Deterministic script + stopword detection on local OCR text; a model only when ambiguous. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.detect-language).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR with per-page confidence, Unicode script analysis, stopword language scoring.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"deskew":{"type":"boolean","description":"Straighten a page that was scanned at a slight angle before reading it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"denoise":{"type":"boolean","description":"Remove scanner noise and specks before reading the page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.detect-language","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/detect-language\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.detectLanguage({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->detectLanguage([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/extract":{"post":{"operationId":"ai.ocr.extract","summary":"Image to structured JSON","description":"OCR plus vision to extract requested fields, entities, dates, amounts and addresses with evidence. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.extract).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR with per-page confidence, ISO date / currency validation, evidence verification.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"deskew":{"type":"boolean","description":"Straighten a page that was scanned at a slight angle before reading it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"denoise":{"type":"boolean","description":"Remove scanner noise and specks before reading the page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"fields":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_ .\\-]*$","description":"Sets the name of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"type":{"type":"string","enum":["string","number","date","currency","boolean","list"],"default":"string","description":"The kind of result to produce.","x-davix-h2i-enum":"AiType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":{"type":"string","maxLength":300,"description":"Sets the description of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}}},"required":["name","type"],"additionalProperties":false,"description":"Sets the item of the result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"The values to find in the text of the picture: a name, a type and a short description for each. Up to 50. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"include":{"type":"array","maxItems":4,"items":{"type":"string","enum":["entities","dates","amounts","addresses"],"description":"Sets the item of the result. Choose one of the allowed values listed with the parameter.","x-davix-h2i-enum":"AiIncludeItem","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"description":"Also collect these kinds of values: entities, dates, amounts or addresses. (JSON-encoded array)","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"},"fields":{"contentType":"application/json"},"include":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.extract","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/extract\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.extract({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->extract([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/formula-table":{"post":{"operationId":"ai.ocr.formula-table","summary":"Formula or table picture to file","description":"Read a picture of a formula or a table into LaTeX, Markdown, CSV or HTML; code builds the table files and checks the LaTeX brackets. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.formula-table).\n\nClassification: ai. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"target":{"type":"string","enum":["auto","latex","markdown","csv","html"],"description":"The format of the result: auto lets the AI choose, or latex, markdown, csv or html.","x-davix-h2i-enum":"AiOcrFormulaTableTarget","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"header":{"type":"boolean","description":"Switch on if the first row of the table is a header.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"keep_empty":{"type":"boolean","description":"Switch on to keep empty cells and rows instead of dropping them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"display":{"type":"boolean","description":"Switch on to write a formula as a display equation on its own line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.formula-table","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/formula-table\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'target=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.formulaTable({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"target\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->formulaTable([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'target' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/handwriting":{"post":{"operationId":"ai.ocr.handwriting","summary":"Handwriting interpretation","description":"Transcribe handwriting with a vision model; reports legibility and uncertain segments. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.handwriting).\n\nClassification: ai. Deterministic stages: image normalisation, PDF page rendering.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.handwriting","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/handwriting\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.handwriting({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->handwriting([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/layout":{"post":{"operationId":"ai.ocr.layout","summary":"Document layout understanding","description":"Real block coordinates from the OCR step; a model only assigns roles and reading order by block id. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.layout).\n\nClassification: hybrid. Deterministic stages: OCR block geometry, image normalisation.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"deskew":{"type":"boolean","description":"Straighten a page that was scanned at a slight angle before reading it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"denoise":{"type":"boolean","description":"Remove scanner noise and specks before reading the page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.layout","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/layout\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.layout({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->layout([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/math":{"post":{"operationId":"ai.ocr.math","summary":"Math solver","description":"Solve a maths problem from a picture or text with the steps shown; code checks plain arithmetic answers itself. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.math).\n\nClassification: ai. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"text":{"type":"string","description":"Inline text input."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"steps":{"type":"boolean","description":"Switch on to show the working step by step, not only the answer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"level":{"type":"string","enum":["school","high-school","university"],"description":"Who the explanation is for: school, high school or university level.","x-davix-h2i-enum":"AiLevel","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"format":{"type":"string","enum":["plain","latex"],"description":"The shape of the result.","x-davix-h2i-enum":"AiOcrMathFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"verify":{"type":"boolean","description":"Check the result against the document before returning it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.math","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/math\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'level=school'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.math({\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"level\": \"school\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->math([\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'level' => 'school',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/qa":{"post":{"operationId":"ai.ocr.qa","summary":"Visual question answering (documents)","description":"Answer a question about a scanned page/image using OCR text and the image. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.qa).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR with per-page confidence.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"question":{"type":"string","description":"The question to answer."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"deskew":{"type":"boolean","description":"Straighten a page that was scanned at a slight angle before reading it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"denoise":{"type":"boolean","description":"Remove scanner noise and specks before reading the page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"answer_style":{"type":"string","enum":["concise","detailed"],"description":"How the answer is written: short, detailed or step by step as the allowed values say.","x-davix-h2i-enum":"AiAnswerStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","question"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.qa","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/qa\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'question=example' \\\n  -F 'quality=standard'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.qa({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"question\": \"example\",\n    \"quality\": \"standard\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->qa([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'question' => 'example',\n    'quality' => 'standard',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/screenshot":{"post":{"operationId":"ai.ocr.screenshot","summary":"Screenshot understanding","description":"Describe a screenshot: app, UI elements, visible text and issues. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.screenshot).\n\nClassification: ai. Deterministic stages: image normalisation.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Image file(s): PNG, JPEG, WebP, GIF, TIFF, AVIF, SVG, BMP, ICO, PNM, TGA, DDS, PSD, JPEG XL, JPEG 2000, EPS/AI/PS. Type is detected from content; non-raster formats are converted to PNG before the model sees them. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.screenshot","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/screenshot\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.screenshot({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->screenshot([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/text":{"post":{"operationId":"ai.ocr.text","summary":"Image to text (OCR)","description":"Local OCR with confidence; a vision model is used only when OCR is unreadable and strategy allows. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.text).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR with per-page confidence, image normalisation.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"deskew":{"type":"boolean","description":"Straighten a page that was scanned at a slight angle before reading it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"denoise":{"type":"boolean","description":"Remove scanner noise and specks before reading the page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"min_confidence":{"type":"number","minimum":0,"maximum":100,"description":"How sure the built-in reader must be about a page, from 0 to 100. Pages it is less sure about are read again with an AI that sees the picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.text","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/text\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.text({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->text([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/ai/ocr/understand":{"post":{"operationId":"ai.ocr.understand","summary":"Document text understanding","description":"Explain a scanned document: summary, type, language and key information. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.understand).\n\nClassification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction, OCR with per-page confidence.","tags":["AI","AI:ocr"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"File(s): PDF, image (any format the platform reads), DOCX/XLSX/PPTX/ODT/ODS/ODP/RTF, legacy DOC/XLS/PPT, or plain text (including LaTeX, reStructuredText, MediaWiki and EML read as text). Type is detected from content. Max 1.","x-davix-h2i-file":{"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"model":{"type":"string","default":"auto","description":"\"auto\" (dynamically selected) or an explicit model id."},"on_unsupported":{"type":"string","enum":["error","ignore"],"default":"error","description":"What to do when the chosen model cannot honour one of the request parameters: \"error\" (default) refuses the call, \"ignore\" runs it anyway and reports a warning.","x-davix-h2i-enum":"AiOnUnsupported","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 ai_input_invalid.","evidence":"src/api/ai/schemas/common/request.schema.js:OnUnsupported"}},"fallback":{"type":"boolean","description":"Allow automatic fallback to another eligible model even when `model` is explicit."},"generation":{"type":"string","description":"JSON-encoded generation parameters: {temperature,top_p,top_k,max_tokens,seed,frequency_penalty,presence_penalty,stop[]}."},"instructions":{"type":"string","description":"Free-form instructions / generation prompt."},"language":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}([-_][A-Za-z0-9]{2,8})*$","description":"Language of the answer, as a language code such as \"en\", \"fr\" or \"pt-BR\". By default the language of the input is used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"quality":{"type":"string","enum":["standard","high"],"description":"\"standard\" (default) is the normal balance of speed and cost; \"high\" reads and checks the document more thoroughly and costs more time.","x-davix-h2i-enum":"AiQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"strategy":{"type":"string","enum":["auto","local","vision"],"description":"How the document is read: \"auto\" (default) lets the platform decide, \"local\" reads the text and runs OCR on this server only, \"vision\" sends the page images to a vision model.","x-davix-h2i-enum":"AiStrategy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"pages":{"type":"string","maxLength":200,"pattern":"^(all|first|\\d+(-\\d+)?(,\\s*\\d+(-\\d+)?)*)$","description":"Which pages to use: \"all\" (default), \"first\", or a list such as \"1-3,5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"grounding":{"type":"string","enum":["strict","flag","off"],"description":"How strictly every result must be backed by the document text: \"strict\" removes anything that cannot be found in the document, \"flag\" keeps it but marks it unverified, \"off\" does no check.","x-davix-h2i-enum":"AiGrounding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"deskew":{"type":"boolean","description":"Straighten a page that was scanned at a slight angle before reading it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"denoise":{"type":"boolean","description":"Remove scanner noise and specks before reading the page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/ai (Zod strict schema)"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. All the files of the request belong to one job; the AI answer envelope is the job result (GET /v1/jobs/{id}). Studio never sends it: this is for API calls.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"generation":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The Davix H2I AI response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEnvelope"}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request could not be processed as specified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Feature not available on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream output invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Upstream timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["ai_configuration_error","ai_feature_unavailable","ai_generation_failed","ai_input_invalid","ai_input_too_large","ai_model_incompatible","ai_model_not_found","ai_output_invalid","ai_parameter_unsupported","ai_processing_failed","ai_provider_unavailable","ai_quota_exceeded","ai_rate_limited","ai_security_rejected","ai_timeout","api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"ai.ocr.understand","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"ai","rateLimitCategory":"ai","supportedMetrics":["requests","upload_bytes","response_bytes","ai_tokens","ai_cost_usd","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","ai_tokens_per_request","ai_usd_per_request","ai_tokens_period","ai_model_max_price"],"jobEligible":true,"studioReachable":true,"demoVisible":true,"group":"ocr"},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/ai/ocr/understand\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'on_unsupported=error' \\\n  -F 'quality=standard' \\\n  -F 'strategy=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.ai.ocr.understand({\n    \"files\": 'document.pdf',\n    \"on_unsupported\": \"error\",\n    \"quality\": \"standard\",\n    \"strategy\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->ai()->ocr()->understand([\n    'files' => 'document.pdf',\n    'on_unsupported' => 'error',\n    'quality' => 'standard',\n    'strategy' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/capabilities":{"get":{"operationId":"capabilities","summary":"Runtime-verified capability discovery","description":"Runtime-verified capability discovery","tags":["Meta"],"security":[],"responses":{"200":{"description":"Capability document.","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"scope":{"type":"string","enum":["runtime"]},"contract":{"type":"object"},"account":{"type":"object"},"generatedAt":{"type":"string","format":"date-time"},"images":{"type":"object"},"pdfs":{"type":"object"},"render":{"type":"object"},"presets":{"type":"object"},"data":{"type":"object"},"idempotency":{"type":"object"},"runtime":{"type":"object"}},"required":["version","scope","contract","account","generatedAt","images","pdfs","render","presets","data","idempotency","runtime"],"additionalProperties":true,"description":"RUNTIME capabilities of this deployment (installed tools, encoders, languages). Section sub-objects are open: their keys depend on what is installed."}}}}},"x-davix-h2i-id":"capabilities","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/capabilities\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.capabilities.get();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->capabilities()->get();\necho $result->requestId;"}]}},"/v1/capabilities/{section}":{"get":{"operationId":"capabilities._section_","summary":"Runtime capabilities: one section","description":"One section of the runtime capabilities (images, pdfs, render, ...) with the list of its features.","tags":["Meta"],"security":[],"parameters":[{"name":"section","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_]{1,40}$"},"description":"A capability section, e.g. pdfs. List them with GET /v1/capabilities."}],"responses":{"200":{"description":"One section of the runtime capabilities (images, pdfs, render, .","content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["runtime"]},"section":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"features":{"type":"array","items":{"type":"string"}},"data":{"type":"object"}},"required":["scope","section","generatedAt","features","data"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"capabilities.{section}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/capabilities/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.capabilitiesSection({\n    \"section\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->capabilitiesSection([\n    'section' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/capabilities/{section}/{feature}":{"get":{"operationId":"capabilities._section_._feature_","summary":"Runtime capabilities: one feature","description":"One feature of one runtime capability section, e.g. pdfs/ocr.","tags":["Meta"],"security":[],"parameters":[{"name":"section","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_]{1,40}$"},"description":"A capability section, e.g. pdfs."},{"name":"feature","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_]{1,40}$"},"description":"A feature of that section, e.g. ocr or toImages."}],"responses":{"200":{"description":"One feature of one runtime capability section, e.","content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["runtime"]},"section":{"type":"string"},"feature":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"data":{}},"required":["scope","section","feature","generatedAt"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"capabilities.{section}.{feature}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/capabilities/example/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.capabilitiesFeature({\n    \"section\": \"example\",\n    \"feature\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->capabilitiesFeature([\n    'section' => 'example',\n    'feature' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/certificates":{"get":{"operationId":"certificates","summary":"List stored certificates","description":"The customer's stored signing certificates: name, subject, issuer, SHA-256 fingerprint and validity. Never the private keys.","tags":["Certificates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Certificate"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"certificates","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/certificates\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.certificates.list();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->certificates()->list();\necho $result->requestId;"}]},"post":{"operationId":"certificates.post","summary":"Store a signing certificate","description":"Stores a certificate and its private key once so POST /v1/pdfs/sign can use it by `certificateId` instead of receiving the key with every request. The private key is stored encrypted and is never returned. Individual customer keys only; the number you may keep is set by the platform.","tags":["Certificates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80,"description":"A name for the certificate, unique among yours.","x-davix-h2i-behavior":{"onInvalid":"reject","onMissing":"reject","evidence":"src/platform/certificates/certificate-service.js"}},"certPem":{"type":"string","description":"The certificate in PEM form (-----BEGIN CERTIFICATE-----). It must not have expired.","x-davix-h2i-behavior":{"onInvalid":"reject","onMissing":"reject","evidence":"src/platform/certificates/certificate-service.js"}},"keyPem":{"type":"string","description":"The matching private key in PEM form, without a passphrase. It is stored encrypted and never returned.","x-davix-h2i-behavior":{"onInvalid":"reject","onMissing":"reject","note":"A key that does not belong to the certificate, or one protected by a passphrase -> 400 invalid_parameter.","evidence":"src/platform/certificates/certificate-service.js"}}},"required":["name","certPem","keyPem"]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"certificate":{"$ref":"#/components/schemas/Certificate"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["certificate"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","certificate_limit_reached","certificates_unavailable","duplicate_certificate_name","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"certificates.post","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/certificates\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"example\",\"certPem\":\"example\",\"keyPem\":\"example\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.certificates.create({\n    \"name\": \"example\",\n    \"certPem\": \"example\",\n    \"keyPem\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->certificates()->create([\n    'name' => 'example',\n    'certPem' => 'example',\n    'keyPem' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/certificates/{id}":{"delete":{"operationId":"certificates._id_.delete","summary":"Delete a stored certificate","description":"Deletes the certificate and its private key. Only the customer's own; anything else is 404 not_found.","tags":["Certificates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Certificate id (from GET /v1/certificates)."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"id":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["deleted","id"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"certificates.{id}.delete","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X DELETE \"$DAVIX_H2I_URL/v1/certificates/1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.certificates.delete({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->certificates()->delete([\n    'id' => 1,\n]);\necho $result->requestId;"}]},"get":{"operationId":"certificates._id_","summary":"One stored certificate","description":"One stored certificate (never its private key). Someone else's, or an unknown id, is 404 not_found.","tags":["Certificates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Certificate id (from GET /v1/certificates)."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"certificate":{"$ref":"#/components/schemas/Certificate"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["certificate"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"certificates.{id}","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/certificates/1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.certificates.get({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->certificates()->get([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/contract":{"get":{"operationId":"contract","summary":"The canonical Davix H2I API contract (machine-readable)","description":"The complete, versioned, machine-readable description of the external API: every endpoint with its parameters (types, enums, minimum/maximum, defaults, behaviour), actions, errors, authentication and limits that are static. This is the same document the OpenAPI file, the registry and the official SDKs are generated from. It contains NO runtime (installed tools) or account-specific (plan/quota) data: see GET /v1/capabilities and GET /v1/usage for those.","tags":["Meta"],"security":[],"responses":{"200":{"description":"The canonical contract document (contract.json).","content":{"application/json":{"schema":{"type":"object","properties":{"contractVersion":{"type":"string"},"metadataSchemaVersion":{"type":"integer"},"apiVersion":{"type":"string"},"endpoints":{"type":"array","items":{"type":"object"}},"enums":{"type":"array","items":{"type":"object"}},"errors":{"type":"array","items":{"type":"object"}},"capabilities":{"type":"object"},"hash":{"type":"string"}},"required":["contractVersion","metadataSchemaVersion","endpoints","enums","errors"],"additionalProperties":true,"description":"The public API contract (see metadataSchemaVersion). Same document the SDKs bundle."}}}}},"x-davix-h2i-id":"contract","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contract();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contract();\necho $result->requestId;"}]}},"/v1/contract/auth":{"get":{"operationId":"contract.auth","summary":"Contract: authentication, headers, retry and request policy","description":"How to authenticate, the headers the API uses, the retry rules and the paths a generic client may call.","tags":["Meta"],"security":[],"responses":{"200":{"description":"How to authenticate, the headers the API uses, the retry rules and the paths a generic client may call.","content":{"application/json":{"schema":{"type":"object","properties":{"info":{"type":"object"},"servers":{"type":"array","items":{"type":"object"}},"auth":{"type":"object"},"headers":{"type":"object"},"retry":{"type":"object"},"requestPolicy":{"type":"object"}},"required":["auth","headers","retry","requestPolicy"]}}}}},"x-davix-h2i-id":"contract.auth","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/auth\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractAuth();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractAuth();\necho $result->requestId;"}]}},"/v1/contract/categories":{"get":{"operationId":"contract.categories","summary":"Contract: categories","description":"The endpoint categories with the number of endpoints in each.","tags":["Meta"],"security":[],"responses":{"200":{"description":"The endpoint categories with the number of endpoints in each.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"endpoints":{"type":"integer"}},"required":["name","endpoints"]}}},"required":["total","results"]}}}}},"x-davix-h2i-id":"contract.categories","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/categories\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractCategories();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractCategories();\necho $result->requestId;"}]}},"/v1/contract/categories/{name}":{"get":{"operationId":"contract.categories._name_","summary":"Contract: one category","description":"Every endpoint of one category, in full.","tags":["Meta"],"security":[],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9 _-]{1,40}$"},"description":"A category name, case-sensitive, e.g. Images or PDFs. List them with GET /v1/contract/categories."}],"responses":{"200":{"description":"Every endpoint of one category, in full.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"total":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ContractEndpoint"}}},"required":["name","total","results"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.categories.{name}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/categories/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractCategory({\n    \"name\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractCategory([\n    'name' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/endpoints":{"get":{"operationId":"contract.endpoints","summary":"Contract: endpoint index","description":"A light list of every endpoint (id, sdk name, method, path, name, category, audience, auth, content type, async/upload/idempotent flags, field count, tags) plus facet counts. The map to the rest of the contract; filter it locally.","tags":["Meta"],"security":[],"responses":{"200":{"description":"A light list of every endpoint (id, sdk name, method, path, name, category, audience, auth, content type, async/upload/idempotent flags, field count, tags) plus facet counts.","content":{"application/json":{"schema":{"type":"object","properties":{"contractVersion":{"type":"string"},"hash":{"type":"string"},"total":{"type":"integer"},"facets":{"type":"object","properties":{"category":{"type":"object"},"method":{"type":"object"},"contentType":{"type":"object"},"audience":{"type":"object"},"auth":{"type":"object"},"flags":{"type":"object","properties":{"async":{"type":"integer"},"upload":{"type":"integer"},"idempotent":{"type":"integer"},"deprecated":{"type":"integer"}},"required":["async","upload","idempotent","deprecated"]}},"required":["category","method","contentType","audience","auth","flags"]},"results":{"type":"array","items":{"$ref":"#/components/schemas/ContractEndpointSummary"}}},"required":["contractVersion","hash","total","facets","results"]}}}}},"x-davix-h2i-id":"contract.endpoints","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/endpoints\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEndpoints();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEndpoints();\necho $result->requestId;"}]}},"/v1/contract/endpoints/{id}":{"get":{"operationId":"contract.endpoints._id_","summary":"Contract: one endpoint","description":"One endpoint exactly as it appears in the full contract: fields, limits, behaviours, response schema, errors.","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"An endpoint id or SDK name, e.g. images.optimize or jobs.get (percent-encode \"{\" and \"}\"). List them with GET /v1/contract/endpoints."}],"responses":{"200":{"description":"One endpoint exactly as it appears in the full contract: fields, limits, behaviours, response schema, errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractEndpoint"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.endpoints.{id}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/endpoints/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEndpoint({\n    \"id\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEndpoint([\n    'id' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/endpoints/{id}/actions":{"get":{"operationId":"contract.endpoints._id_.actions","summary":"Contract: the actions of one endpoint","description":"The actions (operations) of a multi-action endpoint, with the extra fields each needs. Empty for endpoints without actions.","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"An endpoint id or SDK name, e.g. images.optimize or jobs.get (percent-encode \"{\" and \"}\"). List them with GET /v1/contract/endpoints."}],"responses":{"200":{"description":"The actions (operations) of a multi-action endpoint, with the extra fields each needs.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string"},"selector":{"type":"string","nullable":true},"style":{"type":"string","nullable":true},"total":{"type":"integer"},"results":{"type":"array","items":{"type":"object"}}},"required":["endpoint","total","results"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.endpoints.{id}.actions","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/endpoints/example/actions\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEndpointActions({\n    \"id\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEndpointActions([\n    'id' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/endpoints/{id}/errors":{"get":{"operationId":"contract.endpoints._id_.errors","summary":"Contract: the errors of one endpoint","description":"The error codes one endpoint can return, each in full (statuses, retryable, meaning).","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"An endpoint id or SDK name, e.g. images.optimize or jobs.get (percent-encode \"{\" and \"}\"). List them with GET /v1/contract/endpoints."}],"responses":{"200":{"description":"The error codes one endpoint can return, each in full (statuses, retryable, meaning).","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string"},"statuses":{"type":"array","items":{"type":"integer"}},"total":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ContractErrorDef"}}},"required":["endpoint","statuses","total","results"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.endpoints.{id}.errors","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/endpoints/example/errors\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEndpointErrors({\n    \"id\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEndpointErrors([\n    'id' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/endpoints/{id}/examples":{"get":{"operationId":"contract.endpoints._id_.examples","summary":"Contract: examples for one endpoint","description":"Generated cURL, Node.js and PHP examples for one endpoint.","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"An endpoint id or SDK name, e.g. images.optimize or jobs.get (percent-encode \"{\" and \"}\"). List them with GET /v1/contract/endpoints."}],"responses":{"200":{"description":"Generated cURL, Node.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string"},"curl":{"type":"string"},"node":{"type":"string"},"php":{"type":"string"},"request":{"type":"object"},"error":{"type":"object"}},"required":["endpoint","curl","node","php"],"additionalProperties":true}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.endpoints.{id}.examples","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/endpoints/example/examples\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEndpointExamples({\n    \"id\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEndpointExamples([\n    'id' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/endpoints/{id}/fields":{"get":{"operationId":"contract.endpoints._id_.fields","summary":"Contract: the parameters of one endpoint","description":"Every request parameter of one endpoint, in full.","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"An endpoint id or SDK name, e.g. images.optimize or jobs.get (percent-encode \"{\" and \"}\"). List them with GET /v1/contract/endpoints."}],"responses":{"200":{"description":"Every request parameter of one endpoint, in full.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string"},"contentType":{"type":"string","nullable":true},"total":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ContractField"}}},"required":["endpoint","total","results"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.endpoints.{id}.fields","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/endpoints/example/fields\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEndpointFields({\n    \"id\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEndpointFields([\n    'id' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/endpoints/{id}/fields/{name}":{"get":{"operationId":"contract.endpoints._id_.fields._name_","summary":"Contract: one parameter of one endpoint","description":"One request parameter exactly as in the full contract: type, required, default, enum, minimum/maximum, how the server treats bad values.","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"An endpoint id or SDK name, e.g. images.optimize or jobs.get (percent-encode \"{\" and \"}\"). List them with GET /v1/contract/endpoints."},{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._\\[\\]-]{1,100}$"},"description":"A parameter name as listed by the endpoint, e.g. quality or enhance.blur (nested names are dotted)."}],"responses":{"200":{"description":"One request parameter exactly as in the full contract: type, required, default, enum, minimum/maximum, how the server treats bad values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractField"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.endpoints.{id}.fields.{name}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/endpoints/example/fields/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEndpointField({\n    \"id\": \"example\",\n    \"name\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEndpointField([\n    'id' => 'example',\n    'name' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/endpoints/{id}/response":{"get":{"operationId":"contract.endpoints._id_.response","summary":"Contract: the response of one endpoint","description":"The success statuses and the response body schema of one endpoint.","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"An endpoint id or SDK name, e.g. images.optimize or jobs.get (percent-encode \"{\" and \"}\"). List them with GET /v1/contract/endpoints."}],"responses":{"200":{"description":"The success statuses and the response body schema of one endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string"},"response":{"type":"object"}},"required":["endpoint","response"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.endpoints.{id}.response","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/endpoints/example/response\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEndpointResponse({\n    \"id\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEndpointResponse([\n    'id' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/enums":{"get":{"operationId":"contract.enums","summary":"Contract: enums","description":"The shared enums (name, description, number of values).","tags":["Meta"],"security":[],"responses":{"200":{"description":"The shared enums (name, description, number of values).","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"valueCount":{"type":"integer"}},"required":["name","valueCount"]}}},"required":["total","results"]}}}}},"x-davix-h2i-id":"contract.enums","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/enums\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEnums();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEnums();\necho $result->requestId;"}]}},"/v1/contract/enums/{name}":{"get":{"operationId":"contract.enums._name_","summary":"Contract: one enum","description":"One enum with all its values.","tags":["Meta"],"security":[],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_]{1,80}$"},"description":"An enum name, e.g. ResizeFit."}],"responses":{"200":{"description":"One enum with all its values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractEnum"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.enums.{name}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/enums/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractEnum({\n    \"name\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractEnum([\n    'name' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/errors":{"get":{"operationId":"contract.errors","summary":"Contract: error codes","description":"Every error code the API can return, each with statuses, retryable flag and meaning.","tags":["Meta"],"security":[],"responses":{"200":{"description":"Every error code the API can return, each with statuses, retryable flag and meaning.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ContractErrorDef"}}},"required":["total","results"]}}}}},"x-davix-h2i-id":"contract.errors","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/errors\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractErrors();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractErrors();\necho $result->requestId;"}]}},"/v1/contract/errors/{code}":{"get":{"operationId":"contract.errors._code_","summary":"Contract: one error code","description":"One error code in full.","tags":["Meta"],"security":[],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,79}$"},"description":"An error code, e.g. rate_limit_exceeded."}],"responses":{"200":{"description":"One error code in full.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractErrorDef"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.errors.{code}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/errors/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractError({\n    \"code\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractError([\n    'code' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/contract/schemas":{"get":{"operationId":"contract.schemas","summary":"Contract: shared response schemas","description":"The named response shapes shared by several endpoints.","tags":["Meta"],"security":[],"responses":{"200":{"description":"The named response shapes shared by several endpoints.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","nullable":true}},"required":["name"]}}},"required":["total","results"]}}}}},"x-davix-h2i-id":"contract.schemas","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/schemas\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractSchemas();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractSchemas();\necho $result->requestId;"}]}},"/v1/contract/schemas/{name}":{"get":{"operationId":"contract.schemas._name_","summary":"Contract: one shared response schema","description":"One shared response shape as JSON Schema.","tags":["Meta"],"security":[],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_]{1,80}$"},"description":"A schema name, e.g. Job."}],"responses":{"200":{"description":"One shared response shape as JSON Schema.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"schema":{"type":"object"}},"required":["name","schema"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"contract.schemas.{name}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/contract/schemas/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.contractSchema({\n    \"name\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->contractSchema([\n    'name' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/data/aggregate":{"post":{"operationId":"data.aggregate","summary":"Group and pivot data","description":"Group the rows of a data file and total each group: count, sum, average, smallest, largest and more. With pivot, the values of one column become the columns of the result, like a pivot table.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The data file to group.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"group_by":{"type":"string","example":"country","description":"Column(s) to group by, separated by commas (or a JSON array). Rows with the same values in these columns become one row of the result. Leave it empty to total the whole file into one row.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/aggregate.js"}},"aggregations":{"type":"string","maxLength":20000,"example":"sum:amount, count","description":"What to calculate for each group, as function:column separated by commas, for example sum:amount, avg:price, count. Functions: count, sum, avg, min, max, median, count_distinct, first, last, list. A JSON array of { function, column, as } also works and lets you name the result column. Default: count.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown function, or a function other than count without a column -> 400.","evidence":"src/processing/data/aggregate.js"}},"pivot":{"type":"string","example":"year","description":"A column whose values become the columns of the result (a cross table). It needs exactly one aggregation. Example: group_by=country, pivot=year, aggregations=sum:amount gives one row per country and one column per year.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 200 different values, more than one aggregation, or a column also used in group_by -> 400.","evidence":"src/processing/data/aggregate.js"}},"sort":{"type":"string","example":"sum_amount desc","description":"A column of the result to sort by; add desc for largest first, for example \"sum_amount desc\". Default: sorted by the group columns.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a column of the result -> 400 (details.available lists them).","evidence":"src/processing/data/aggregate.js"}},"limit":{"type":"integer","minimum":1,"maximum":200000,"description":"Keep only the first rows of the result, for example 10 for a top ten.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/aggregate.js"}},"totals":{"type":"boolean","default":false,"description":"true: add a last row named Total that adds up the count and sum columns.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/aggregate.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Format of the result (default csv).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"For to=json: { data, rows, columns, column_names, groups, warnings? } inline. For every other format: { url, sizeBytes, rows, columns, column_names, groups, warnings? }.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"groups":{"type":"integer","description":"How many groups were found."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data","rows","columns","column_names"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"groups":{"type":"integer","description":"How many groups were found."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","rows","columns","column_names"]}],"description":"to=json -> {data}; every other format -> {url,sizeBytes} of the result file."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.aggregate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/aggregate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'group_by=country' \\\n  -F 'aggregations=sum:amount, count' \\\n  -F 'pivot=year'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.aggregate({\n    \"file\": 'document.pdf',\n    \"group_by\": \"country\",\n    \"aggregations\": \"sum:amount, count\",\n    \"pivot\": \"year\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->aggregate([\n    'file' => 'document.pdf',\n    'group_by' => 'country',\n    'aggregations' => 'sum:amount, count',\n    'pivot' => 'year',\n]);\necho $result->requestId;"}]}},"/v1/data/anonymize":{"post":{"operationId":"data.anonymize","summary":"Anonymize data","description":"Hide personal details in a data file so it is safe to share: mask, replace, scramble or remove names, emails, phone numbers and other columns. It can find the personal columns by itself.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The data file to anonymize.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"rules":{"type":"string","maxLength":100000,"example":"[{\"column\":\"name\",\"method\":\"pseudonym\"},{\"column\":\"email\",\"method\":\"mask\"}]","description":"What to do with which column, as a JSON array of { column, method }. Methods: redact (replace with a fixed text), mask (stars, keeping the last characters), hash (a code that is the same for the same value), pseudonym (Name 1, Name 2 ...), email (hide the part before @), blank (empty the cell), drop (remove the column), round (round numbers to a step), year (keep only the year of a date), shuffle (mix the values between rows). Options: text, keep_last, keep_first, prefix, step.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown column or method -> 400.","evidence":"src/processing/data/anonymize.js"}},"detect":{"type":"boolean","description":"true: also find columns that look personal (email, phone, card number, IP address, name, address, birth date, password) and treat them automatically. Default: true when rules is empty, false otherwise. The answer lists what was found.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/anonymize.js"}},"salt":{"type":"string","maxLength":200,"description":"A secret word for the hash method. Use the same salt on two files and the same value gets the same code in both, so they can still be matched. Without it every request uses a new random salt.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/anonymize.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that makes shuffle repeatable: the same seed mixes the rows the same way again.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/anonymize.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Format of the result (default: the same as the source).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"For to=json: { data, rows, columns, column_names, anonymized: [{ column, method, detected_as?, cells }], warnings? } inline. For every other format: { url, sizeBytes, rows, columns, column_names, anonymized, warnings? }.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"anonymized":{"type":"array","items":{"type":"object"},"description":"One entry per treated column: column, method, detected_as (when found automatically) and cells changed."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data","rows","columns","column_names","anonymized"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"anonymized":{"type":"array","items":{"type":"object"},"description":"One entry per treated column: column, method, detected_as (when found automatically) and cells changed."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","rows","columns","column_names","anonymized"]}],"description":"to=json -> {data}; every other format -> {url,sizeBytes} of the result file."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.anonymize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/anonymize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'rules=[{\"column\":\"name\",\"method\":\"pseudonym\"},{\"column\":\"email\",\"method\":\"mask\"}]' \\\n  -F 'seed=0' \\\n  -F 'to=xlsx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.anonymize({\n    \"file\": 'document.pdf',\n    \"rules\": \"[{\\\"column\\\":\\\"name\\\",\\\"method\\\":\\\"pseudonym\\\"},{\\\"column\\\":\\\"email\\\",\\\"method\\\":\\\"mask\\\"}]\",\n    \"seed\": 0,\n    \"to\": \"xlsx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->anonymize([\n    'file' => 'document.pdf',\n    'rules' => '[{\"column\":\"name\",\"method\":\"pseudonym\"},{\"column\":\"email\",\"method\":\"mask\"}]',\n    'seed' => 0,\n    'to' => 'xlsx',\n]);\necho $result->requestId;"}]}},"/v1/data/bank":{"post":{"operationId":"data.bank","summary":"Bank file convert","description":"Read a bank statement (OFX / QFX, QIF, MT940, CAMT.053) into a table of transactions, or turn a table from a bank's CSV export (dates, decimal commas, debit and credit columns) into a QIF, OFX or CAMT.053 file that accounting programs import.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The bank statement, or a table of bank rows (CSV, TSV, Excel, JSON ...).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"from":{"type":"string","enum":["auto","ofx","qif","mt940","camt053","table"],"default":"auto","description":"auto (default), ofx, qif, mt940, camt053 or table.","x-davix-h2i-enum":"DataBankFrom","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"to":{"type":"string","enum":["table","qif","ofx","camt053"],"default":"table","description":"table (default), qif, ofx or camt053.","x-davix-h2i-enum":"DataBankTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"table_format":{"type":"string","enum":["csv","tsv","xlsx","json","ndjson","md","html"],"default":"csv","description":"to=table: the format of the table: csv (default), tsv, xlsx, json, ndjson, md or html.","x-davix-h2i-enum":"DataTableFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/data/bank.js"}},"date_order":{"type":"string","enum":["auto","dmy","mdy","ymd"],"default":"auto","description":"Table rows: auto (default), dmy, mdy or ymd for dates such as 05/11/2026.","x-davix-h2i-enum":"DataDateOrder","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"decimal":{"type":"string","enum":["auto","dot","comma"],"default":"auto","description":"Table rows: the decimal mark: auto (default), dot or comma.","x-davix-h2i-enum":"DataDecimal","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"date_column":{"type":"string","example":"Datum","description":"Table rows: the date column (default: found by name).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"amount_column":{"type":"string","example":"Betrag","description":"Table rows: the amount column (default: found by name).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"debit_column":{"type":"string","example":"Debit","description":"Table rows: a column with money going out (instead of amount_column).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"credit_column":{"type":"string","example":"Credit","description":"Table rows: a column with money coming in.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"description_column":{"type":"string","example":"Verwendungszweck","description":"Table rows: the description column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"payee_column":{"type":"string","example":"Name","description":"Table rows: the counterparty column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"reference_column":{"type":"string","example":"Reference","description":"Table rows: the reference column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"balance_column":{"type":"string","example":"Saldo","description":"Table rows: the balance column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"type_column":{"type":"string","example":"Type","description":"Table rows: the type or category column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"currency_column":{"type":"string","example":"Currency","description":"Table rows: the currency column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"currency":{"type":"string","example":"EUR","description":"The three-letter currency for rows without one (for example EUR); in a written file it is the account currency.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"account":{"type":"string","example":"DE89370400440532013000","description":"The account number (IBAN) written into the file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"bank_id":{"type":"string","example":"37040044","description":"to=ofx: the bank id.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"negate":{"type":"boolean","default":false,"description":"true: swap the sign of every amount. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"direction":{"type":"string","enum":["all","credit","debit"],"default":"all","description":"all (default), credit (money in) or debit (money out).","x-davix-h2i-enum":"DataDirection","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"since":{"type":"string","example":"2026-11-01","description":"Only transactions from this date on (YYYY-MM-DD).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"until":{"type":"string","example":"2026-11-30","description":"Only transactions up to this date (YYYY-MM-DD).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"sort":{"type":"string","enum":["file","date","date_desc"],"default":"file","description":"file (default), date or date_desc.","x-davix-h2i-enum":"DataBankSort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"include_balance":{"type":"boolean","default":true,"description":"true (default): a balance column when the rows have one.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"include_account":{"type":"boolean","default":false,"description":"true: an account column in the table. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/bank.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, from, transactions, credits, debits, net, firstDate?, lastDate?, closingBalance?, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"from":{"type":"string"},"transactions":{"type":"integer"},"credits":{"type":"number","description":"The sum of the money in."},"debits":{"type":"number","description":"The sum of the money out (negative)."},"net":{"type":"number"},"firstDate":{"type":"string"},"lastDate":{"type":"string"},"closingBalance":{"type":"number","description":"The closing balance, when the statement has one."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","from","transactions","credits","debits","net"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.bank","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/bank\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'from=auto' \\\n  -F 'to=table' \\\n  -F 'table_format=csv'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.bank({\n    \"file\": 'document.pdf',\n    \"from\": \"auto\",\n    \"to\": \"table\",\n    \"table_format\": \"csv\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->bank([\n    'file' => 'document.pdf',\n    'from' => 'auto',\n    'to' => 'table',\n    'table_format' => 'csv',\n]);\necho $result->requestId;"}]}},"/v1/data/calendar":{"post":{"operationId":"data.calendar","summary":"Calendar file","description":"Read an .ics calendar file into a table of events (repeating events can be expanded into every date), or build an .ics file from a table or a list of events, with reminders, time zones, all-day events and repeat rules.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"An .ics file to read, or a table (CSV, Excel, JSON ...) of events to turn into a calendar.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"action":{"type":"string","enum":["auto","read","create"],"default":"auto","description":"read (an .ics file into a table), create (a table or the events parameter into an .ics file) or auto (default: an .ics file is read, anything else is built).","x-davix-h2i-enum":"DataAction","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"events":{"type":"array","example":"[{\"summary\":\"Kick-off\",\"start\":\"2026-11-20T09:00\",\"end\":\"2026-11-20T10:00\",\"location\":\"Room 4\"}]","items":{"type":"object","properties":{"summary":{"type":"string","description":"The title."},"start":{"type":"string","description":"The start: YYYY-MM-DD for an all-day event, YYYY-MM-DDTHH:MM for a time (add Z or an offset such as +01:00 to name the zone)."},"end":{"type":"string","description":"The end, written the same way."},"all_day":{"type":"boolean","description":"true for an all-day event."},"location":{"type":"string","description":"Where."},"description":{"type":"string","description":"Details."},"url":{"type":"string","description":"A link."},"organizer":{"type":"string","description":"The organizer e-mail address."},"attendees":{"type":"array","items":{"type":"string"},"description":"E-mail addresses of the guests."},"categories":{"type":"array","items":{"type":"string"},"description":"Labels."},"status":{"type":"string","description":"CONFIRMED, TENTATIVE or CANCELLED."},"reminder_minutes":{"type":"integer","description":"A reminder this many minutes before."},"recurrence":{"type":"string","description":"A repeat rule such as FREQ=WEEKLY;COUNT=10."},"timezone":{"type":"string","description":"The time zone name of this event."},"uid":{"type":"string","description":"A fixed event id."}}},"description":"To build a calendar without a file: a list of events { summary, start, end, all_day, location, description, url, organizer, attendees, categories, status, reminder_minutes, recurrence, timezone, uid }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"mapping":{"type":"object","example":"{\"summary\":\"Column A\"}","description":"Which column holds which event field, when the column names are not the usual ones: { \"<field>\": \"<column name>\" }. Fields: summary, start, end, all_day, location, description, url, organizer, attendees, categories, status, reminder_minutes, uid, recurrence, timezone.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown field or a missing column -> 400 (details.columns lists the real ones).","evidence":"src/processing/data/calendar.js"}},"timezone":{"type":"string","example":"Europe/Berlin","description":"A time zone name such as Europe/Berlin. Reading: times are shown in this zone with their offset (default UTC). Building: times without an offset are taken as being in this zone.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"from_date":{"type":"string","example":"2026-11-01","description":"Reading: only events on or after this date, YYYY-MM-DD.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"to_date":{"type":"string","example":"2026-12-31","description":"Reading: only events on or before this date, YYYY-MM-DD. With expand it also ends the repeats (default: five years after the start).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"expand":{"type":"boolean","default":false,"description":"Reading: true writes a row for every date of a repeating event (daily, weekly, monthly, yearly, with interval, count, until, by-day and exceptions). Default false: one row per event, with the rule in the recurrence column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"max_events":{"type":"integer","minimum":1,"maximum":10000,"default":1000,"description":"Reading: the most rows to write, 1 to 10000 (default 1000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"sort":{"type":"string","enum":["start","none"],"default":"start","description":"Reading: start (default, oldest first) or none (the order of the file).","x-davix-h2i-enum":"DataCalendarSort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"calendar_name":{"type":"string","example":"Project plan","description":"Building: the name of the calendar, shown by calendar apps.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"default_duration_minutes":{"type":"integer","minimum":1,"maximum":10080,"default":60,"description":"Building: how long an event lasts when it has no end, 1 to 10080 (default 60).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"reminder_minutes":{"type":"integer","minimum":0,"maximum":40320,"description":"Building: add a reminder this many minutes before every event that has none of its own, 0 to 40320.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"all_day":{"type":"boolean","default":false,"description":"Building: true makes every event an all-day event. Default false (an event is all-day when its start is a date without a time).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"all_day_end_inclusive":{"type":"boolean","default":true,"description":"Building: true (default) means the end date of an all-day event is its last day; false means it is the day after (the way the .ics format counts).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"method":{"type":"string","enum":["PUBLISH","REQUEST","CANCEL"],"default":"PUBLISH","description":"Building: PUBLISH (default), REQUEST (an invitation) or CANCEL (marks every event cancelled).","x-davix-h2i-enum":"DataCalendarMethod","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"uid_domain":{"type":"string","example":"example.com","description":"Building: the host name used to make event ids, for example example.com (default davix-h2i.local).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/calendar.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"When reading an .ics file: the format of the table of events (default json). Ignored when an .ics file is built.","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"events":{"contentType":"application/json"},"mapping":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Reading: { data | url, sizeBytes, events, calendar: { name, timezone, prodid, method }, recurring, rows, columns, column_names, warnings? }. Building: { url, sizeBytes, events, skipped, method, warnings? }.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"events":{"type":"integer"},"calendar":{"type":"object","description":"name, timezone, prodid and method of the calendar file."},"recurring":{"type":"integer"},"rows":{"type":"integer"},"columns":{"type":"integer"},"column_names":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data","events","calendar","recurring","rows","columns","column_names"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"events":{"type":"integer"},"calendar":{"type":"object","description":"Reading only: name, timezone, prodid and method."},"recurring":{"type":"integer"},"skipped":{"type":"integer"},"method":{"type":"string","enum":["PUBLISH","REQUEST","CANCEL"]},"rows":{"type":"integer"},"columns":{"type":"integer"},"column_names":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","events"]}],"description":"Reading with to=json -> { data, ... }; reading to another format -> { url, ... }; building -> { url, sizeBytes, events, skipped, method }."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.calendar","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/calendar\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'action=auto' \\\n  -F 'events=[{\"summary\":\"Kick-off\",\"start\":\"2026-11-20T09:00\",\"end\":\"2026-11-20T10:00\",\"location\":\"Room 4\"}]' \\\n  -F 'mapping={\"summary\":\"Column A\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.calendar({\n    \"action\": \"auto\",\n    \"events\": \"[{\\\"summary\\\":\\\"Kick-off\\\",\\\"start\\\":\\\"2026-11-20T09:00\\\",\\\"end\\\":\\\"2026-11-20T10:00\\\",\\\"location\\\":\\\"Room 4\\\"}]\",\n    \"mapping\": \"{\\\"summary\\\":\\\"Column A\\\"}\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->calendar([\n    'action' => 'auto',\n    'events' => '[{\"summary\":\"Kick-off\",\"start\":\"2026-11-20T09:00\",\"end\":\"2026-11-20T10:00\",\"location\":\"Room 4\"}]',\n    'mapping' => '{\"summary\":\"Column A\"}',\n]);\necho $result->requestId;"}]}},"/v1/data/clean":{"post":{"operationId":"data.clean","summary":"Clean a data file","description":"Tidy a messy data file: trim extra spaces, empty the cells that only say N/A or null, remove empty rows and repeated rows, tidy the column names, and fix numbers and dates that were typed as text.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The data file to clean.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"trim":{"type":"boolean","default":true,"description":"true (default): remove spaces at the start and end of every cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"collapse_spaces":{"type":"boolean","default":true,"description":"true (default): turn several spaces in a row into one.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"blank_markers":{"type":"boolean","default":true,"description":"true (default): empty the cells that only hold a placeholder such as N/A, NA, null, none, - or ?.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"blank_values":{"type":"string","example":"unknown, tbd","description":"More placeholder words of your own to empty, separated by commas, for example \"unknown, tbd\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"remove_empty_rows":{"type":"boolean","default":true,"description":"true (default): remove rows where every cell is empty.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"remove_empty_columns":{"type":"boolean","default":false,"description":"true: remove columns where every cell is empty.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"dedupe":{"type":"boolean","default":false,"description":"true: remove repeated rows, keeping the first of each. Capital and small letters count as the same.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"dedupe_on":{"type":"string","example":"email","description":"Only compare these columns when looking for repeated rows, separated by commas, for example email. Setting it turns dedupe on.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown column -> 400.","evidence":"src/processing/data/clean.js"}},"headers":{"type":"string","enum":["keep","trim","snake","lower","upper","title"],"default":"trim","description":"How to tidy the column names: trim (default, remove extra spaces), snake (order_date), lower, upper, title (Order Date), or keep (leave them alone).","x-davix-h2i-enum":"DataHeaders","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"text_case":{"type":"string","enum":["keep","lower","upper","title"],"default":"keep","description":"Change the letters of the text in case_columns: lower, upper or title (First Letter Big). Default: keep.","x-davix-h2i-enum":"DataTextCase","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Set without case_columns on a file with more than one column -> 400.","evidence":"src/processing/data/clean.js"}},"case_columns":{"type":"string","example":"city,country","description":"The columns text_case applies to, separated by commas.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"fix_numbers":{"type":"boolean","default":false,"description":"true: turn numbers typed as text into real numbers, for example \"1,250.50\", \"$12\" and \"(300)\". \"15%\" becomes 0.15. Values that start with 0, such as postcodes, are left alone.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"fix_dates":{"type":"boolean","default":false,"description":"true: rewrite dates such as 31/01/2026, 31.01.2026 or 5 Jan 2026 as 2026-01-31, the form every program understands.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"day_first":{"type":"boolean","default":true,"description":"For fix_dates, when a date like 03/04/2026 could be read both ways: true (default) reads it as 3 April, false as March 4.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"fill_empty":{"type":"string","maxLength":1000,"description":"A value to put into empty cells, for example 0 or unknown. Default: leave them empty.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"fill_columns":{"type":"string","example":"country","description":"Only fill the empty cells of these columns, separated by commas. Default: every column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/clean.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Format of the result (default: the same as the source).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"For to=json: { data, rows, columns, column_names, cleaned: { trimmed_cells, blanked_cells, numbers_fixed, dates_fixed, case_changed, filled_cells, removed_rows, duplicates_removed, removed_columns[], renamed_columns[] }, warnings? } inline. For every other format: { url, sizeBytes, rows, columns, column_names, cleaned, warnings? }.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"cleaned":{"type":"object","description":"What was changed: trimmed_cells, blanked_cells, numbers_fixed, dates_fixed, case_changed, filled_cells, removed_rows, duplicates_removed, removed_columns[], renamed_columns[{ from, to }]."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data","rows","columns","column_names","cleaned"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"cleaned":{"type":"object","description":"What was changed: trimmed_cells, blanked_cells, numbers_fixed, dates_fixed, case_changed, filled_cells, removed_rows, duplicates_removed, removed_columns[], renamed_columns[{ from, to }]."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","rows","columns","column_names","cleaned"]}],"description":"to=json -> {data}; every other format -> {url,sizeBytes} of the result file."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.clean","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/clean\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'blank_values=unknown, tbd' \\\n  -F 'dedupe_on=email' \\\n  -F 'headers=trim'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.clean({\n    \"file\": 'document.pdf',\n    \"blank_values\": \"unknown, tbd\",\n    \"dedupe_on\": \"email\",\n    \"headers\": \"trim\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->clean([\n    'file' => 'document.pdf',\n    'blank_values' => 'unknown, tbd',\n    'dedupe_on' => 'email',\n    'headers' => 'trim',\n]);\necho $result->requestId;"}]}},"/v1/data/config":{"post":{"operationId":"data.config","summary":"Config convert","description":"Convert settings files between JSON, YAML, TOML, INI, .env and Java .properties. Lay a second file over the first, fill in ${NAME} references, hide secrets, nest dotted names or flatten nested ones, and sort the keys.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The settings file (JSON, YAML, TOML, INI, .env or .properties).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"other":{"type":"string","format":"binary","description":"A second settings file laid over the first: its values win. It may have another format.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"from":{"type":"string","enum":["auto","json","yaml","toml","ini","env","properties"],"default":"auto","description":"auto (default: from the file name and content) or one of: json, yaml, toml, ini, env, properties.","x-davix-h2i-enum":"DataConfigFrom","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"to":{"type":"string","enum":["json","yaml","toml","ini","env","properties"],"example":"yaml","description":"The format to write: json, yaml, toml, ini, env, properties.","x-davix-h2i-enum":"DataConfigTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"section":{"type":"string","example":"db","description":"Write only this group of settings, for example db.pool.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"flatten":{"type":"boolean","default":false,"description":"true: nested settings become dotted names (db.pool.max). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"expand_keys":{"type":"boolean","default":false,"description":"true: dotted names become nested groups (db.pool.max becomes db > pool > max). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"separator":{"type":"string","default":".","description":"The text between the parts of a nested name when flattening or expanding (default \".\").","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"sort_keys":{"type":"boolean","default":false,"description":"true: sort the keys alphabetically. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"drop_null":{"type":"boolean","default":false,"description":"true: leave out settings without a value. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): read 5432 as a number and true as a boolean in INI, .env and .properties files.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"interpolate":{"type":"boolean","default":false,"description":"true: replace ${NAME} (and ${NAME:-default}) with the setting of that name. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"redact_secrets":{"type":"boolean","default":false,"description":"true: replace the value of settings whose name looks secret (password, token, key ...). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"redact_with":{"type":"string","default":"***","description":"The text written instead of a secret (default ***).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"secret_pattern":{"type":"string","example":"password|token","description":"A regular expression for the names that count as secret (default: password, secret, token, api key, credential, auth ...).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"uppercase_keys":{"type":"boolean","default":false,"description":"true: write the keys in capital letters. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"env_prefix":{"type":"string","example":"APP","description":"to=env: a prefix for every name (APP gives APP_DB_HOST).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"export":{"type":"boolean","default":false,"description":"to=env: start every line with export. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"quote_style":{"type":"string","enum":["quoted","plain","auto"],"default":"auto","description":"Values in .env, INI: quoted, plain or auto (default: quote only when needed).","x-davix-h2i-enum":"DataQuoteStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"array_style":{"type":"string","enum":["index","comma","json"],"default":"index","description":"Lists in .env and .properties: index (a.0, a.1; default), comma or json.","x-davix-h2i-enum":"DataArrayStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"indent":{"type":"integer","minimum":1,"maximum":8,"default":2,"description":"Spaces per level in JSON and YAML, 1 to 8 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/config.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","to"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, from, keys, redacted, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["json","yaml","toml","ini","env","properties"]},"from":{"type":"string","description":"The format that was read."},"keys":{"type":"integer","description":"How many settings the result holds."},"redacted":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","from","keys","redacted"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.config","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/config\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'from=auto' \\\n  -F 'to=yaml' \\\n  -F 'section=db'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.config({\n    \"file\": 'document.pdf',\n    \"from\": \"auto\",\n    \"to\": \"yaml\",\n    \"section\": \"db\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->config([\n    'file' => 'document.pdf',\n    'from' => 'auto',\n    'to' => 'yaml',\n    'section' => 'db',\n]);\necho $result->requestId;"}]}},"/v1/data/contacts":{"post":{"operationId":"data.contacts","summary":"Contact cards","description":"Read a .vcf contact file (vCard 2.1, 3.0 or 4.0, one or thousands of cards) into a table, or build a .vcf file from a table or a list of contacts, with name order, phone and e-mail types, duplicate merging and sorting.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"A .vcf file to read, or a table (CSV, Excel, JSON ...) of contacts to turn into contact cards.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"action":{"type":"string","enum":["auto","read","create"],"default":"auto","description":"read (a .vcf file into a table), create (a table or the contacts parameter into a .vcf file) or auto (default: a .vcf file is read, anything else is built).","x-davix-h2i-enum":"DataAction","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"contacts":{"type":"array","example":"[{\"first_name\":\"Ada\",\"last_name\":\"Lovelace\",\"emails\":\"ada@example.com\",\"phones\":\"+44 20 7946 0000\"}]","items":{"type":"object","properties":{"full_name":{"type":"string","description":"full name"},"first_name":{"type":"string","description":"first name"},"middle_name":{"type":"string","description":"middle name"},"last_name":{"type":"string","description":"last name"},"prefix":{"type":"string","description":"prefix"},"suffix":{"type":"string","description":"suffix"},"nickname":{"type":"string","description":"nickname"},"organization":{"type":"string","description":"organization"},"department":{"type":"string","description":"department"},"title":{"type":"string","description":"title"},"emails":{"type":"string","description":"E-mail addresses separated by ;"},"phones":{"type":"string","description":"Phone numbers separated by ;, each can start with a type such as work:"},"street":{"type":"string","description":"street"},"city":{"type":"string","description":"city"},"region":{"type":"string","description":"region"},"postal_code":{"type":"string","description":"postal code"},"country":{"type":"string","description":"country"},"website":{"type":"string","description":"website"},"birthday":{"type":"string","description":"YYYY-MM-DD"},"note":{"type":"string","description":"note"},"categories":{"type":"string","description":"Groups separated by ;"},"uid":{"type":"string","description":"uid"}}},"description":"To build contact cards without a file: a list of contacts { full_name, first_name, last_name, organization, title, emails, phones, street, city, region, postal_code, country, website, birthday, note, categories }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"mapping":{"type":"object","example":"{\"full_name\":\"Column A\"}","description":"Which column holds which contact field, when the column names are not the usual ones: { \"<field>\": \"<column name>\" }. Fields: full_name, first_name, middle_name, last_name, prefix, suffix, nickname, organization, department, title, emails, phones, street, city, region, postal_code, country, website, birthday, note, categories, uid.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown field or a missing column -> 400 (details.columns lists the real ones).","evidence":"src/processing/data/contacts.js"}},"version":{"type":"string","enum":["3.0","4.0"],"default":"3.0","description":"Building: the vCard version, 3.0 (default, the widest support) or 4.0.","x-davix-h2i-enum":"DataVersion","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"name_order":{"type":"string","enum":["first_last","last_first"],"default":"first_last","description":"Building: how the full name is made from first and last name when there is none: first_last (default, \"Ada Lovelace\") or last_first (\"Lovelace, Ada\").","x-davix-h2i-enum":"DataNameOrder","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"sort":{"type":"string","enum":["name","none"],"default":"none","description":"name (by last name, then first name) or none (default: keep the order).","x-davix-h2i-enum":"DataContactsSort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"dedupe":{"type":"boolean","default":false,"description":"true: merge contacts that share an e-mail address or a phone number (or the same name when they have neither), keeping every address and number. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"phone_type":{"type":"string","enum":["cell","work","home","voice","fax"],"default":"cell","description":"Building: the type of a phone number that does not say its own (\"work: +1 ...\" does): cell (default), work, home, voice or fax.","x-davix-h2i-enum":"DataPhoneType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"email_type":{"type":"string","enum":["internet","work","home"],"default":"internet","description":"Building: the type of an e-mail address that does not say its own: internet (default), work or home.","x-davix-h2i-enum":"DataEmailType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"address_type":{"type":"string","enum":["home","work"],"default":"home","description":"Building: the type of the postal address: home (default) or work.","x-davix-h2i-enum":"DataAddressType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"default_country_code":{"type":"string","example":"49","description":"Building: a calling code such as 49 or +1; a number that starts with 0 gets it instead of the 0.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"max_contacts":{"type":"integer","minimum":1,"maximum":100000,"default":20000,"description":"The most contacts to read or build, 1 to 100000 (default 20000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/contacts.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"When reading a .vcf file: the format of the table of contacts (default json). Ignored when a .vcf file is built.","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"contacts":{"contentType":"application/json"},"mapping":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Reading: { data | url, sizeBytes, contacts, version, rows, columns, column_names, warnings? }. Building: { url, sizeBytes, contacts, version, warnings? }.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"contacts":{"type":"integer"},"version":{"type":"string"},"rows":{"type":"integer"},"columns":{"type":"integer"},"column_names":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data","contacts","rows","columns","column_names"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"contacts":{"type":"integer"},"version":{"type":"string"},"rows":{"type":"integer"},"columns":{"type":"integer"},"column_names":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","contacts"]}],"description":"Reading with to=json -> { data, ... }; reading to another format -> { url, ... }; building -> { url, sizeBytes, contacts, version }."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.contacts","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/contacts\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'action=auto' \\\n  -F 'contacts=[{\"first_name\":\"Ada\",\"last_name\":\"Lovelace\",\"emails\":\"ada@example.com\",\"phones\":\"+44 20 7946 0000\"}]' \\\n  -F 'mapping={\"full_name\":\"Column A\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.contacts({\n    \"action\": \"auto\",\n    \"contacts\": \"[{\\\"first_name\\\":\\\"Ada\\\",\\\"last_name\\\":\\\"Lovelace\\\",\\\"emails\\\":\\\"ada@example.com\\\",\\\"phones\\\":\\\"+44 20 7946 0000\\\"}]\",\n    \"mapping\": \"{\\\"full_name\\\":\\\"Column A\\\"}\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->contacts([\n    'action' => 'auto',\n    'contacts' => '[{\"first_name\":\"Ada\",\"last_name\":\"Lovelace\",\"emails\":\"ada@example.com\",\"phones\":\"+44 20 7946 0000\"}]',\n    'mapping' => '{\"full_name\":\"Column A\"}',\n]);\necho $result->requestId;"}]}},"/v1/data/convert":{"post":{"operationId":"data.convert","summary":"Convert between structured-data formats","description":"Convert CSV, TSV, JSON, NDJSON, XML, YAML, TOML, XLSX, ODS, HTML tables, Markdown tables, SQL dumps, SQLite and Parquet files into one another, with column / filter / sort / limit controls.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The source file.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Target format (see GET /v1/formats?family=data for what the server can write; SQLite and Parquet are read-only).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"columns":{"type":"string","description":"Keep only these columns, in this order (comma-separated or a JSON array). Applied after filter, sort and limit.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown column -> 400 (details.available).","evidence":"src/processing/data/codecs.js"}},"filter":{"type":"string","description":"Keep only rows matching a condition: JSON like {\"column\":\"age\",\"op\":\"gte\",\"value\":18}, an array (all must match), or {\"and\":[...]} / {\"or\":[...]} / {\"not\":{...}}. Operators: eq ne gt gte lt lte in nin contains startswith endswith like empty notempty.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"No regular expressions or code: only these operators.","evidence":"src/processing/data/codecs.js"}},"sort":{"type":"string","description":"Sort rows: comma-separated columns, each optionally :asc or :desc (e.g. \"country,age:desc\"). Empty values sort last.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"limit":{"type":"integer","minimum":0,"maximum":200000,"description":"Keep only the first N rows (after filter and sort).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","to"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"For to=json: {data: <parsed JSON>} inline. For to=csv/xlsx/xml: {url, sizeBytes} -- a signed download URL, matching every other file-producing endpoint in this API.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"rows":{"type":"integer","nullable":true,"description":"Rows written (tables)."},"warnings":{"type":"array","items":{"type":"string"},"description":"What the conversion had to do: flattened keys, a fallback encoding, sheets that were not written ..."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"rows":{"type":"integer","nullable":true,"description":"Rows written (tables)."},"warnings":{"type":"array","items":{"type":"string"},"description":"What the conversion had to do: flattened keys, a fallback encoding, sheets that were not written ..."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes"]}],"description":"to=json -> {data}; every other target -> {url,sizeBytes} of the converted file."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.convert","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/convert\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'to=xlsx' \\\n  -F 'limit=0' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.convert({\n    \"file\": 'document.pdf',\n    \"to\": \"xlsx\",\n    \"limit\": 0,\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->convert([\n    'file' => 'document.pdf',\n    'to' => 'xlsx',\n    'limit' => 0,\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/data/diff":{"post":{"operationId":"data.diff","summary":"Compare two data files","description":"Find the differences between two files: rows added, removed or changed (with the old and new value of each changed field) and the columns that differ. Rows are matched by key columns, or compared as whole rows when no key is given. A number and the same number written as text are equal, and so are a date in a spreadsheet and the same date typed in a CSV; an empty cell only equals an empty cell, and codes with leading zeros (007) and long ID numbers are compared exactly. A CSV separated by semicolons, pipes or tabs is recognised from its first line (and reported in warnings).","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The first (original) file.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats."}},"other":{"type":"string","format":"binary","description":"The second (changed) file.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats."}},"key":{"type":"string","description":"Column(s) that identify a row (comma-separated or a JSON array). Without it rows are compared as a whole, ignoring order.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown column -> 400.","evidence":"src/processing/data/diff.js"}},"sheet":{"type":"string","description":"Sheet / table to compare (default: the first). A file that cannot have several sheets (a CSV or a plain list) beside a workbook is compared as it is.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/diff-input.js"}},"flatten":{"type":"boolean","default":true,"description":"Flatten nested objects to dotted columns before comparing (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"file_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the \"file\" input from this public http(s) address instead of uploading it. For each input send either the file or its URL, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"other_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the \"other\" input from this public http(s) address instead of uploading it. For each input send either the file or its URL, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","other"]}}}},"responses":{"200":{"description":"{ identical, summary: { rows_first, rows_second, added, removed, changed, unchanged }, columns: { added, removed }, added[], removed[], changed: [{ key, changes: [{ column, from, to }] }], truncated, warnings? } — each list holds at most 1,000 entries.","content":{"application/json":{"schema":{"type":"object","properties":{"identical":{"type":"boolean"},"summary":{"type":"object","properties":{"rows_first":{"type":"integer"},"rows_second":{"type":"integer"},"added":{"type":"integer"},"removed":{"type":"integer"},"changed":{"type":"integer"},"unchanged":{"type":"integer"},"identical":{"type":"boolean"}},"required":["rows_first","rows_second","added","removed","changed","unchanged","identical"]},"columns":{"type":"object","properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}},"common":{"type":"integer"}},"required":["added","removed","common"]},"added":{"type":"array","items":{"type":"object"},"description":"At most 1,000 rows only in the second file."},"removed":{"type":"array","items":{"type":"object"},"description":"At most 1,000 rows only in the first file."},"changed":{"type":"array","items":{"type":"object"},"description":"At most 1,000 entries: key and the changed fields with their old and new value."},"truncated":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["identical","summary","columns","added","removed","changed","truncated"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"fixed","field":"file","minFiles":2,"ceiling":2,"directFiles":1,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"data.diff","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","upload_mb_per_request","max_file_size_bytes","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/diff\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'other=@photo.jpg' \\\n  -F 'key=example' \\\n  -F 'sheet=example' \\\n  -F 'flatten=true'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.diff({\n    \"file\": 'document.pdf',\n    \"other\": 'photo.jpg',\n    \"key\": \"example\",\n    \"sheet\": \"example\",\n    \"flatten\": true\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->diff([\n    'file' => 'document.pdf',\n    'other' => 'photo.jpg',\n    'key' => 'example',\n    'sheet' => 'example',\n    'flatten' => true,\n]);\necho $result->requestId;"}]}},"/v1/data/fuzzy-match":{"post":{"operationId":"data.fuzzy-match","summary":"Fuzzy match","description":"Match the rows of two tables by names that are alike but not equal (\"Acme Ltd.\" and \"ACME Limited\"), with six similarity measures, ignored words, blocking and scores; or, with one table, group near-duplicate rows.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The first table (CSV, Excel, JSON ...).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"other":{"type":"string","format":"binary","description":"The second table to match against. Leave it out to find near-duplicates inside the first table.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"other_sheet":{"type":"string","example":"Customers","description":"The sheet of the second table (default: the first).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"left_columns":{"type":"array","example":"[\"Name\"]","items":{"type":"string"},"description":"The column(s) of the first table to compare, as a list or comma-separated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"right_columns":{"type":"array","example":"[\"Company\"]","items":{"type":"string"},"description":"The matching column(s) of the second table, in the same order (default: the same names as left_columns).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"weights":{"type":"array","example":"[3,1]","items":{"type":"string"},"description":"How much each column counts, positive numbers, one per column (default: equal).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"algorithm":{"type":"string","enum":["levenshtein","jaro-winkler","trigram","token-sort","token-set","phonetic"],"default":"jaro-winkler","description":"jaro-winkler (default: typos and short names), levenshtein, trigram, token-sort (word order), token-set (extra words) or phonetic (sounds alike).","x-davix-h2i-enum":"DataAlgorithm","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"threshold":{"type":"number","minimum":0,"maximum":100,"default":85,"description":"The least similarity (0 to 100) for a match (default 85).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"column_threshold":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"The least similarity every single column must reach, 0 to 100 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"ignore_case":{"type":"boolean","default":true,"description":"true (default): upper and lower case do not matter.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"strip_accents":{"type":"boolean","default":true,"description":"true (default): é and e are the same.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"strip_punctuation":{"type":"boolean","default":true,"description":"true (default): punctuation is ignored.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"remove_words":{"type":"array","example":"[\"ltd\",\"limited\",\"gmbh\",\"inc\"]","items":{"type":"string"},"description":"Words to ignore, for example company suffixes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"block":{"type":"string","enum":["none","first-letter","prefix-3","soundex","token"],"default":"none","description":"Compare only rows that share a start or a sound, so big tables stay fast: none (default), first-letter, prefix-3, soundex or token (a shared word).","x-davix-h2i-enum":"DataBlock","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"best_only":{"type":"boolean","default":true,"description":"true (default): one match (the best) per row of the first table.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"max_matches":{"type":"integer","minimum":1,"maximum":20,"default":3,"description":"With best_only=false: the most matches per row, 1 to 20 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"one_to_one":{"type":"boolean","default":false,"description":"true: a row of the second table is used for one row only (the best pairs win). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"output":{"type":"string","enum":["matches","all-left","unmatched-left","unmatched-right"],"default":"matches","description":"matches (default: the matched pairs), all-left (every row of the first table, with its match or blanks), unmatched-left or unmatched-right.","x-davix-h2i-enum":"DataFuzzyMatchOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"dedupe_output":{"type":"string","enum":["all","unique","duplicates"],"default":"all","description":"One table only: all (default: every row with a group number), unique (one row of each group) or duplicates (only the extra rows).","x-davix-h2i-enum":"DataDedupeOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"score_column":{"type":"string","default":"match_score","description":"The name of the score column (default match_score).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"right_prefix":{"type":"string","default":"right_","description":"Text put before a column of the second table whose name is also in the first (default right_).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"group_column":{"type":"string","default":"group","description":"One table only: the name of the group column (default group).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"to":{"type":"string","enum":["csv","tsv","xlsx","json"],"default":"csv","description":"The format of the result: csv (default), tsv, xlsx or json.","x-davix-h2i-enum":"DataFuzzyMatchTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/fuzzy.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","left_columns"]},"encoding":{"left_columns":{"contentType":"application/json"},"right_columns":{"contentType":"application/json"},"weights":{"contentType":"application/json"},"remove_words":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"two tables: { url, sizeBytes, format, mode: \"match\", algorithm, threshold, rows, pairs, candidates, matches, matched, unmatchedLeft, unmatchedRight, left, right, averageScore, warnings? }. one table: { ..., mode: \"dedupe\", rows, groups, duplicates, unique }.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"mode":{"type":"string","enum":["match","dedupe"]},"algorithm":{"type":"string"},"threshold":{"type":"number"},"rows":{"type":"integer"},"pairs":{"type":"integer","description":"How many pairs were compared."},"candidates":{"type":"integer","description":"How many pairs reached the threshold."},"matches":{"type":"integer"},"matched":{"type":"integer","description":"How many rows of the first table found a match."},"unmatchedLeft":{"type":"integer"},"unmatchedRight":{"type":"integer"},"left":{"type":"integer"},"right":{"type":"integer"},"averageScore":{"type":"number","description":"The mean score of the matches."},"groups":{"type":"integer","description":"dedupe: groups with more than one row."},"duplicates":{"type":"integer"},"unique":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","mode","algorithm","threshold","rows"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.fuzzy-match","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/fuzzy-match\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'other_sheet=Customers' \\\n  -F 'left_columns=[\"Name\"]' \\\n  -F 'right_columns=[\"Company\"]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.fuzzyMatch({\n    \"file\": 'document.pdf',\n    \"other_sheet\": \"Customers\",\n    \"left_columns\": \"[\\\"Name\\\"]\",\n    \"right_columns\": \"[\\\"Company\\\"]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->fuzzyMatch([\n    'file' => 'document.pdf',\n    'other_sheet' => 'Customers',\n    'left_columns' => '[\"Name\"]',\n    'right_columns' => '[\"Company\"]',\n]);\necho $result->requestId;"}]}},"/v1/data/generate":{"post":{"operationId":"data.generate","summary":"Generate sample data","description":"Make an invented table for demos and tests: customers, orders, products, employees or transactions, or your own columns. All values are made up. The same seed gives the same table again.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"template":{"type":"string","enum":["customers","orders","products","employees","transactions"],"description":"A ready-made table: customers, orders, products, employees or transactions. Default: customers. Use this or columns, not both.","x-davix-h2i-enum":"DataTemplate","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/generate.js"}},"rows":{"type":"integer","minimum":1,"maximum":10000,"default":100,"description":"How many rows to make (default 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/generate.js"}},"columns":{"type":"string","maxLength":100000,"example":"[{\"name\":\"id\",\"type\":\"id\"},{\"name\":\"email\",\"type\":\"email\"},{\"name\":\"plan\",\"type\":\"choice\",\"values\":[\"free\",\"pro\"]}]","description":"Your own columns, as a JSON array of { name, type }. Types: id, uuid, first_name, last_name, full_name, email, phone, company, job_title, department, street, city, country, country_code, zip, date, datetime, integer, number, price, boolean, choice, product, category, status, color, word, sentence, paragraph, url, ip, constant. Options: min, max, decimals (numbers), from, to (dates), values (choice), value (constant), true_percent (boolean), start, prefix, pad (id), words (sentence), empty_percent (any).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown type, a missing name, more than 100 columns, or template and columns together -> 400.","evidence":"src/processing/data/generate.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Format of the result (default csv).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A number that makes the result repeatable: the same seed with the same settings gives the same table. Leave it empty for a new table each time.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/generate.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}}}}},"responses":{"200":{"description":"For to=json: { data, rows, columns, column_names, template?, warnings? } inline. For every other format: { url, sizeBytes, rows, columns, column_names, template?, warnings? }.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"template":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data","rows","columns","column_names"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"template":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","rows","columns","column_names"]}],"description":"to=json -> {data}; every other format -> {url,sizeBytes} of the result file."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"data.generate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","allow_fmt_data_extended","allow_fmt_legacy_office","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/generate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'template=customers' \\\n  -F 'rows=100' \\\n  -F 'columns=[{\"name\":\"id\",\"type\":\"id\"},{\"name\":\"email\",\"type\":\"email\"},{\"name\":\"plan\",\"type\":\"choice\",\"values\":[\"free\",\"pro\"]}]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.generate({\n    \"template\": \"customers\",\n    \"rows\": 100,\n    \"columns\": \"[{\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"id\\\"},{\\\"name\\\":\\\"email\\\",\\\"type\\\":\\\"email\\\"},{\\\"name\\\":\\\"plan\\\",\\\"type\\\":\\\"choice\\\",\\\"values\\\":[\\\"free\\\",\\\"pro\\\"]}]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->generate([\n    'template' => 'customers',\n    'rows' => 100,\n    'columns' => '[{\"name\":\"id\",\"type\":\"id\"},{\"name\":\"email\",\"type\":\"email\"},{\"name\":\"plan\",\"type\":\"choice\",\"values\":[\"free\",\"pro\"]}]',\n]);\necho $result->requestId;"}]}},"/v1/data/geo":{"post":{"operationId":"data.geo","summary":"Map data convert","description":"Convert map data between GeoJSON, KML, GPX, WKT and tables with latitude and longitude columns. Reproject, cut to a box, simplify lines, round coordinates, choose the properties to keep, and get the count, bounding box, length and area.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"A GeoJSON, KML, GPX or WKT file, or a table (CSV, Excel, JSON ...) with latitude and longitude columns (or a WKT column).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"to":{"type":"string","enum":["geojson","kml","gpx","csv","wkt"],"default":"geojson","description":"The format of the result: geojson (default), kml, gpx, csv (one row per feature, with latitude, longitude and wkt columns) or wkt (one geometry per line).","x-davix-h2i-enum":"DataGeoTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"lat_column":{"type":"string","example":"latitude","description":"For a table: the column with the latitude (default: found by its name: lat, latitude, y).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"lon_column":{"type":"string","example":"longitude","description":"For a table: the column with the longitude (default: lon, lng, longitude, x).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"geometry_column":{"type":"string","example":"wkt","description":"For a table: a column with the shape as WKT (default: a column named wkt, geometry or geom).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"from_crs":{"type":"string","enum":["4326","3857"],"default":"4326","description":"The coordinate system of a table: 4326 (longitude and latitude in degrees, default) or 3857 (Web Mercator metres). GeoJSON, KML and GPX are always 4326.","x-davix-h2i-enum":"DataFromCrs","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"to_crs":{"type":"string","enum":["4326","3857"],"default":"4326","description":"The coordinate system of the result: 4326 (default) or 3857 (Web Mercator, written with a crs member in GeoJSON).","x-davix-h2i-enum":"DataToCrs","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"bbox":{"type":"string","example":"5.9,47.3,15.0,55.1","description":"Keep only the features that touch this box: min_longitude,min_latitude,max_longitude,max_latitude in degrees.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"simplify":{"type":"number","minimum":0,"maximum":100000,"default":0,"description":"Make lines and outlines lighter: points closer than this many metres to the straight line are dropped (Douglas-Peucker). Default 0 (off).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"precision":{"type":"integer","minimum":0,"maximum":10,"default":6,"description":"Decimals kept in every coordinate, 0 to 10 (default 6, about 11 cm). In Web Mercator at most 3.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"elevation":{"type":"boolean","default":true,"description":"true (default): keep the height (the third number of a coordinate, ele in GPX). false: drop it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"keep_properties":{"type":"array","example":"[\"name\",\"population\"]","items":{"type":"string"},"description":"Keep only these properties of every feature, as a list or comma-separated. Default: all.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"drop_properties":{"type":"array","example":"[\"internal_id\"]","items":{"type":"string"},"description":"Remove these properties of every feature.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"name_property":{"type":"string","example":"title","description":"Copy this property into name, which KML and GPX show as the label of a feature.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"title":{"type":"string","example":"Offices","description":"The name of the whole file, written into KML and GPX.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"pretty":{"type":"boolean","default":false,"description":"true: indent the result (GeoJSON, KML, GPX). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/geo.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"keep_properties":{"contentType":"application/json"},"drop_properties":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, source, crs, features, geometryTypes, positions, bbox, lengthKm, areaKm2, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["geojson","kml","gpx","csv","wkt"]},"source":{"type":"string","description":"What the input was: geojson, kml, gpx, wkt, or the table format (csv, xlsx ...)."},"crs":{"type":"string","description":"The coordinate system of the result, for example EPSG:4326."},"features":{"type":"integer"},"geometryTypes":{"type":"object","description":"How many features of each geometry type (Point, LineString, Polygon ...)."},"positions":{"type":"integer","description":"How many coordinate pairs the result holds."},"bbox":{"type":"array","items":{"type":"number"},"description":"min_longitude, min_latitude, max_longitude, max_latitude of the result, in degrees (null when empty)."},"lengthKm":{"type":"number","description":"The total length of lines, along the earth surface."},"areaKm2":{"type":"number","description":"The total area of polygons (holes subtracted)."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","crs","features","geometryTypes","positions","lengthKm","areaKm2"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.geo","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/geo\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'to=geojson' \\\n  -F 'lat_column=latitude' \\\n  -F 'lon_column=longitude'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.geo({\n    \"file\": 'document.pdf',\n    \"to\": \"geojson\",\n    \"lat_column\": \"latitude\",\n    \"lon_column\": \"longitude\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->geo([\n    'file' => 'document.pdf',\n    'to' => 'geojson',\n    'lat_column' => 'latitude',\n    'lon_column' => 'longitude',\n]);\necho $result->requestId;"}]}},"/v1/data/localization":{"post":{"operationId":"data.localization","summary":"Localization file convert","description":"Convert translation files between JSON, Flutter ARB, gettext PO, XLIFF, Android strings.xml, iOS .strings, Java .properties and YAML; put several languages side by side in a table (or make a file per language from a table) and see missing keys, extra keys, empty texts and changed {placeholders}.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The translation files, one per language (or one table with a column per language).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"from":{"type":"string","enum":["auto","table","json","arb","po","xliff","android","strings","properties","yaml"],"default":"auto","description":"auto (default: from the file name and content), table or one of: json, arb, po, xliff, android, strings, properties, yaml.","x-davix-h2i-enum":"DataLocalizationFrom","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"to":{"type":"string","enum":["table","json","arb","po","xliff","android","strings","properties","yaml"],"default":"table","description":"table (default: all languages side by side) or the format to write: json, arb, po, xliff, android, strings, properties, yaml. One language gives a file, several give a ZIP with a file each.","x-davix-h2i-enum":"DataLocalizationTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"table_format":{"type":"string","enum":["csv","tsv","xlsx","json","ndjson","md","html"],"default":"csv","description":"to=table: the format of the table: csv (default), tsv, xlsx, json, ndjson, md or html.","x-davix-h2i-enum":"DataTableFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/data/localization.js"}},"languages":{"type":"array","example":"[\"en\",\"de\"]","items":{"type":"string"},"description":"The language code of each file, in order (default: from the file itself or its name, such as de.json).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"source_language":{"type":"string","default":"en","example":"en","description":"The language the texts were written in (default en): used by XLIFF and to fill empty texts.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"language":{"type":"string","example":"de","description":"Write only this language (one file instead of a ZIP).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"key_column":{"type":"string","default":"key","description":"When a table comes in or goes out: the column with the keys (default key).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"separator":{"type":"string","default":".","description":"The text between the parts of a nested key (default \".\").","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"flat":{"type":"boolean","default":false,"description":"JSON and YAML output: keep keys flat (app.title) instead of nesting. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"indent":{"type":"integer","minimum":1,"maximum":8,"default":2,"description":"JSON and YAML: spaces per level, 1 to 8 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"sort_keys":{"type":"boolean","default":false,"description":"true: sort the keys. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"empty_values":{"type":"string","enum":["keep","drop","fill"],"default":"keep","description":"keep (default), drop (leave out empty texts) or fill (use the source language text).","x-davix-h2i-enum":"DataEmptyValues","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"check":{"type":"boolean","default":true,"description":"true (default): compare the languages and list the problems.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"keep_comments":{"type":"boolean","default":true,"description":"true (default): keep translator notes where the format has them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"key_prefix":{"type":"string","example":"web.","description":"Text put before every key.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"strip_prefix":{"type":"string","example":"web.","description":"Text taken off the start of every key.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/localization.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"languages":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, container?, outputFiles?, files, from, languages, keys, issueCount, issues: [{ language, key, issue, source?, target? }], warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"container":{"type":"string","enum":["file","zip"],"description":"Whether the link is one file or a ZIP (a file per language)."},"outputFiles":{"type":"integer"},"files":{"type":"integer"},"from":{"type":"string"},"languages":{"type":"array","items":{"type":"string"},"description":"The languages that were read."},"keys":{"type":"integer","description":"How many different keys there are."},"issueCount":{"type":"integer"},"issues":{"type":"array","items":{"type":"object"},"description":"language, key and issue (missing, extra, empty, placeholders differ); the first 200."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","files","from","languages","keys","issueCount","issues"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.localization","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/localization\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'from=auto' \\\n  -F 'to=table' \\\n  -F 'table_format=csv'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.localization({\n    \"files\": 'document.pdf',\n    \"from\": \"auto\",\n    \"to\": \"table\",\n    \"table_format\": \"csv\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->localization([\n    'files' => 'document.pdf',\n    'from' => 'auto',\n    'to' => 'table',\n    'table_format' => 'csv',\n]);\necho $result->requestId;"}]}},"/v1/data/logs":{"post":{"operationId":"data.logs","summary":"Parse logs","description":"Read a log file (Apache / nginx access log, syslog, JSON lines, logfmt or your own pattern) into a table with real dates, the request split into method and path, and numbers; filter by time, status, level or text; add a summary of the busiest paths, addresses and statuses, the bytes and the requests per hour.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The log file (text, up to 60 MB).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"format":{"type":"string","enum":["auto","access","syslog","json","logfmt","custom"],"default":"auto","description":"auto (default: recognised from the first lines), access, syslog, json, logfmt or custom (with pattern).","x-davix-h2i-enum":"DataLogsFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"pattern":{"type":"string","example":"(?<ip>\\S+) (?<msg>.*)","description":"A regular expression with named groups, such as (?<ip>\\S+) (?<msg>.*), for lines in your own format (up to 1000 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"year":{"type":"integer","minimum":1970,"maximum":2100,"description":"syslog lines have no year: the year to use (default the current year).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"max_lines":{"type":"integer","minimum":1,"maximum":1000000,"default":1000000,"description":"Read at most this many lines, 1 to 1,000,000 (default 1,000,000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"since":{"type":"string","example":"2026-11-17T10:00:00Z","description":"Only lines from this date or time on.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"until":{"type":"string","example":"2026-11-17T12:00:00Z","description":"Only lines up to this date or time.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"status":{"type":"array","example":"[\"404\",\"5xx\"]","items":{"type":"string"},"description":"Only these HTTP statuses or classes, as a list or comma-separated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"level":{"type":"array","example":"[\"error\",\"warn\"]","items":{"type":"string"},"description":"Only these levels (JSON lines, logfmt, syslog severity).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"contains":{"type":"string","example":"/api","description":"Only lines that contain this text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"exclude":{"type":"string","example":"healthcheck","description":"Leave out lines that contain this text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"exclude_bots":{"type":"boolean","default":false,"description":"true: leave out requests by crawlers and tools (user agent). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"fields":{"type":"array","example":"[\"time\",\"ip\",\"status\"]","items":{"type":"string"},"description":"Only these columns, in this order.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"split_request":{"type":"boolean","default":true,"description":"true (default): split the request into method, path and protocol (access logs).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"parse_dates":{"type":"boolean","default":true,"description":"true (default): write times as ISO 8601 (UTC). false: milliseconds since 1970.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"line_numbers":{"type":"boolean","default":false,"description":"true: add a column with the line number. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"keep_unparsed":{"type":"boolean","default":false,"description":"true: keep lines that could not be read, in an unparsed column. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"sort":{"type":"string","enum":["file","time","time_desc"],"default":"file","description":"file (default), time or time_desc.","x-davix-h2i-enum":"DataLogsSort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"summary":{"type":"boolean","default":false,"description":"true: add a summary (requests, per hour, status, method, path, ip, user agent, bytes). In an Excel result it is a second sheet.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"top":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"With summary: how many of the busiest values to list, 1 to 100 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/logs.js"}},"to":{"type":"string","enum":["csv","tsv","xlsx","json","ndjson","md","html"],"default":"csv","description":"The format of the result: csv, tsv, xlsx, json, ndjson, md, html (default csv).","x-davix-h2i-enum":"DataTableTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/data/route-kit.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"status":{"contentType":"application/json"},"level":{"contentType":"application/json"},"fields":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, logFormat, lines, parsed, skipped, blank, kept, rows, first?, last?, unparsedLines?, summary?: [{ section, value, count }], warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"logFormat":{"type":"string","enum":["access","syslog","json","logfmt","custom"],"description":"The log format that was read."},"lines":{"type":"integer"},"parsed":{"type":"integer"},"skipped":{"type":"integer","description":"Lines that could not be read."},"blank":{"type":"integer"},"kept":{"type":"integer","description":"Lines left after the filters."},"rows":{"type":"integer"},"first":{"type":"string"},"last":{"type":"string"},"unparsedLines":{"type":"array","items":{"type":"integer"},"description":"The first line numbers that could not be read."},"summary":{"type":"array","items":{"type":"object"},"description":"section, value and count rows of the summary."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","logFormat","lines","parsed","skipped","blank","kept","rows"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.logs","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/logs\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'format=auto' \\\n  -F 'pattern=(?<ip>\\S+) (?<msg>.*)' \\\n  -F 'year=1970'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.logs({\n    \"file\": 'document.pdf',\n    \"format\": \"auto\",\n    \"pattern\": \"(?<ip>\\\\S+) (?<msg>.*)\",\n    \"year\": 1970\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->logs([\n    'file' => 'document.pdf',\n    'format' => 'auto',\n    'pattern' => '(?<ip>\\\\S+) (?<msg>.*)',\n    'year' => 1970,\n]);\necho $result->requestId;"}]}},"/v1/data/merge":{"post":{"operationId":"data.merge","summary":"Merge several data files into one","description":"Combine two or more data files (any readable formats): append their rows (columns are united), or join them on key columns (inner, left, right, outer). Writes one file in any writable format.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":2,"maxItems":20,"description":"Two to 20 files to merge, in upload order.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats."}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Target format (default csv).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"mode":{"type":"string","enum":["append","join"],"default":"append","description":"append (default): stack the rows, uniting the columns; join: match rows on the columns in `on`.","x-davix-h2i-enum":"DataMergeMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"on":{"type":"string","description":"mode=join: the column(s) to join on (comma-separated or a JSON array); numbers and numeric text match.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Required for mode=join; unknown column -> 400.","evidence":"src/processing/data/codecs.js"}},"join_type":{"type":"string","enum":["inner","left","right","outer"],"default":"inner","description":"mode=join: inner (default), left, right or outer. Columns with the same name in a later file get a _2, _3 ... suffix.","x-davix-h2i-enum":"DataJoinType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"source_column":{"type":"string","description":"mode=append: add a column with this name holding the name of the file each row came from.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"sheet":{"type":"string","description":"Sheet / table to read from every file (default: the first).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, rows, columns, files_merged, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"rows":{"type":"integer"},"columns":{"type":"integer"},"files_merged":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","rows","columns","files_merged"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":2,"ceiling":20,"directFiles":20,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"data.merge","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/merge\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'to=xlsx' \\\n  -F 'mode=append' \\\n  -F 'join_type=inner'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.merge({\n    \"files\": 'document.pdf',\n    \"to\": \"xlsx\",\n    \"mode\": \"append\",\n    \"join_type\": \"inner\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->merge([\n    'files' => 'document.pdf',\n    'to' => 'xlsx',\n    'mode' => 'append',\n    'join_type' => 'inner',\n]);\necho $result->requestId;"}]}},"/v1/data/outliers":{"post":{"operationId":"data.outliers","summary":"Find outliers and trend","description":"Flag numbers that sit far from the rest (z-score, median absolute deviation or interquartile range), per group if you like, and describe the trend of a column over time (straight line, moving average or exponential smoothing) with a forecast of the next values.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The table to analyse (CSV, TSV, JSON, Excel, ODS ... and the other formats the data tools read).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"columns":{"type":"array","example":"[\"amount\"]","items":{"type":"string"},"description":"The numeric columns to check (default: every column that holds numbers).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"method":{"type":"string","enum":["zscore","mad","iqr"],"default":"zscore","description":"zscore (default), mad (robust against extremes) or iqr (box plot rule).","x-davix-h2i-enum":"DataOutliersMethod","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"threshold":{"type":"number","minimum":0.1,"maximum":100,"description":"How far counts as an outlier: standard deviations (zscore, default 3), scaled deviations (mad, default 3.5) or interquartile ranges (iqr, default 1.5), 0.1 to 100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"side":{"type":"string","enum":["both","high","low"],"default":"both","description":"both (default), high (only too large) or low (only too small).","x-davix-h2i-enum":"DataSide","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"group_by":{"type":"array","example":"[\"region\"]","items":{"type":"string"},"description":"Judge every group of these columns on its own.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"min_values":{"type":"integer","minimum":3,"maximum":1000,"default":5,"description":"The fewest numbers a column (or group) needs, 3 to 1000 (default 5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"ignore_zeros":{"type":"boolean","default":false,"description":"true: leave zeros out of the calculation. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"trend":{"type":"string","enum":["none","linear","moving_average","exponential"],"default":"none","description":"none (default), linear (a straight line), moving_average or exponential.","x-davix-h2i-enum":"DataTrend","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"x_column":{"type":"string","example":"date","description":"The column that orders the values: dates or numbers (default: the row order).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"window":{"type":"integer","minimum":2,"maximum":1000,"default":3,"description":"moving_average: how many values are averaged, 2 to 1000 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"alpha":{"type":"number","minimum":0.01,"maximum":1,"default":0.3,"description":"exponential: the weight of the newest value, 0.01 to 1 (default 0.3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"forecast":{"type":"integer","minimum":0,"maximum":1000,"default":0,"description":"How many values to forecast with a trend, 0 to 1000 (default 0). They are in the answer and in a Forecast sheet of an Excel result.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"output":{"type":"string","enum":["annotate","outliers","summary"],"default":"annotate","description":"annotate (default: the table with score, flag and trend columns), outliers (only the flagged rows) or summary (one row per column and group).","x-davix-h2i-enum":"DataOutliersOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"add_scores":{"type":"boolean","default":true,"description":"true (default): a score column for each checked column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"flag_column":{"type":"string","default":"outlier","description":"The name of the flag column (default outlier; with several columns it is added to the column name).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/outliers.js"}},"to":{"type":"string","enum":["csv","tsv","xlsx","json","ndjson","md","html"],"default":"csv","description":"The format of the result: csv, tsv, xlsx, json, ndjson, md, html (default csv).","x-davix-h2i-enum":"DataTableTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/data/route-kit.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"columns":{"contentType":"application/json"},"group_by":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, method, threshold, trend, rows, columns, groups, outliers, summary: [{ column, values, outliers, mean, median, stdev, min, max, lower_bound, upper_bound, slope?, r2?, direction? }], forecast?: [{ column, step, forecast }], warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"method":{"type":"string"},"threshold":{"type":"number"},"trend":{"type":"string"},"rows":{"type":"integer"},"columns":{"type":"integer"},"groups":{"type":"integer"},"outliers":{"type":"integer","description":"How many numbers were flagged."},"summary":{"type":"array","items":{"type":"object"},"description":"One entry per column and group with the statistics, the bounds and, with a trend, slope, r2 and direction."},"forecast":{"type":"array","items":{"type":"object"},"description":"column, step and forecast for each forecast value."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","method","threshold","trend","rows","columns","groups","outliers","summary"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.outliers","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/outliers\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'columns=[\"amount\"]' \\\n  -F 'method=zscore' \\\n  -F 'threshold=0.1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.outliers({\n    \"file\": 'document.pdf',\n    \"columns\": \"[\\\"amount\\\"]\",\n    \"method\": \"zscore\",\n    \"threshold\": 0.1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->outliers([\n    'file' => 'document.pdf',\n    'columns' => '[\"amount\"]',\n    'method' => 'zscore',\n    'threshold' => 0.1,\n]);\necho $result->requestId;"}]}},"/v1/data/path-query":{"post":{"operationId":"data.path-query","summary":"JSON / XML query","description":"Run JSONPath queries on a JSON, YAML, TOML, XML or table file ($.items[*].price, $..name, filters such as [?(@.price > 10 && @.tags contains 'sale')], slices, unions) and get the matches as a table, with the first ones inline.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The JSON, YAML, TOML, XML or table file to search.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"query":{"type":"string","example":"$..price","description":"A JSONPath such as $.store.book[*].title. Send this or queries.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"queries":{"type":"array","example":"[\"$..title\",\"$..price\"]","items":{"type":"string"},"description":"Several JSONPaths (at most 50), as a list or one per line. The result then has a query column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"mode":{"type":"string","enum":["all","first","last","count","exists"],"default":"all","description":"all (default), first, last, count (how many matches) or exists (true / false).","x-davix-h2i-enum":"DataPathQueryMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"max_results":{"type":"integer","minimum":1,"maximum":200000,"default":1000,"description":"How many matches are returned inline, 1 to 200000 (default 1000). The file always has all of them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"default":{"type":"string","example":"n/a","description":"The value used when a query matches nothing (JSON or text).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"include_paths":{"type":"boolean","default":true,"description":"true (default): a path column with the exact path of every match.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"include_types":{"type":"boolean","default":false,"description":"true: a type column (string, number, boolean, null, array, object). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"flatten_results":{"type":"boolean","default":false,"description":"true: a matched list is split into one row per item. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"unique":{"type":"boolean","default":false,"description":"true: only the first of equal values. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"sort":{"type":"string","enum":["asc","desc"],"description":"Sort the matches by value: asc or desc (default: document order).","x-davix-h2i-enum":"DataPathQuerySort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"strict":{"type":"boolean","default":false,"description":"true: refuse the request when a query matches nothing. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/path-query.js"}},"to":{"type":"string","enum":["csv","tsv","xlsx","json","ndjson","md","html"],"default":"json","description":"The format of the matches file: csv, tsv, xlsx, json, ndjson, md, html (default json).","x-davix-h2i-enum":"DataTableTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/data/route-kit.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"queries":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, matches, queries: [{ query, count }], results: [{ query?, path?, value, type? }], resultsTruncated?, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"matches":{"type":"integer","description":"How many values matched in all."},"queries":{"type":"array","items":{"type":"object"},"description":"query and count for each JSONPath."},"results":{"type":"array","items":{"type":"object"},"description":"The first matches: path, value, type."},"resultsTruncated":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","matches","queries","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.path-query","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/path-query\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'query=$..price' \\\n  -F 'queries=[\"$..title\",\"$..price\"]' \\\n  -F 'mode=all'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.pathQuery({\n    \"file\": 'document.pdf',\n    \"query\": \"$..price\",\n    \"queries\": \"[\\\"$..title\\\",\\\"$..price\\\"]\",\n    \"mode\": \"all\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->pathQuery([\n    'file' => 'document.pdf',\n    'query' => '$..price',\n    'queries' => '[\"$..title\",\"$..price\"]',\n    'mode' => 'all',\n]);\necho $result->requestId;"}]}},"/v1/data/profile":{"post":{"operationId":"data.profile","summary":"Profile a data file","description":"Describe what is in a data file: for every column its type, how many cells are filled or empty, how many different values, the smallest, largest and average, and the most common values. Also counts empty and repeated rows.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The data file to describe.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"columns":{"type":"string","example":"country,amount","description":"Only describe these columns, separated by commas (or a JSON array). Default: every column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/profile.js"}},"top":{"type":"integer","minimum":0,"maximum":50,"default":5,"description":"How many of the most common values to list for each column (default 5; 0 lists none).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/profile.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Leave empty to get the report in the answer. Choose a format to also get the report as a file, one row per column.","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ sheet, rows, columns, empty_rows, duplicate_rows, column_profiles: [{ name, type, filled, empty, empty_percent, distinct, unique, min?, max?, sum?, mean?, median?, stddev?, earliest?, latest?, min_length?, max_length?, top?: [{ value, count }], examples[] }], warnings? }. With `to` set to a format other than json the answer also carries { url, sizeBytes } of the report file.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"sheet":{"type":"string"},"rows":{"type":"integer"},"columns":{"type":"integer"},"empty_rows":{"type":"integer"},"duplicate_rows":{"type":"integer"},"column_profiles":{"type":"array","items":{"type":"object"},"description":"One entry per column: name, type (integer, number, text, date, boolean, mixed, empty), filled, empty, empty_percent, distinct, unique, and where they apply min, max, sum, mean, median, stddev, earliest, latest, min_length, max_length, top[], examples[]."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["sheet","rows","columns","empty_rows","duplicate_rows","column_profiles"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.profile","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/profile\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'columns=country,amount' \\\n  -F 'top=5' \\\n  -F 'to=xlsx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.profile({\n    \"file\": 'document.pdf',\n    \"columns\": \"country,amount\",\n    \"top\": 5,\n    \"to\": \"xlsx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->profile([\n    'file' => 'document.pdf',\n    'columns' => 'country,amount',\n    'top' => 5,\n    'to' => 'xlsx',\n]);\necho $result->requestId;"}]}},"/v1/data/query":{"post":{"operationId":"data.query","summary":"Query data files with SQL","description":"Run one SQL SELECT over one or more data files: filter, group, total, sort and join them like database tables. Writes the result in any writable format.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":20,"description":"One to 20 data files. Each file becomes a table named t1, t2 and so on, in upload order. A name taken from the file also works, so orders.csv is also the table orders.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats."}},"query":{"type":"string","maxLength":20000,"example":"SELECT country, COUNT(*) AS orders FROM t1 GROUP BY country","description":"The SQL query to run, in the SQLite dialect. Only one query that reads data can run, so it must start with SELECT or WITH. Put column names that contain spaces in double quotes.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Missing -> 400 missing_field. Not a SELECT, more than one statement, a SQL mistake or an unknown table / column -> 400 invalid_parameter; details.available lists the tables and their columns. A query that runs longer than 30 s is stopped -> 400 (details.reason = query_timeout).","evidence":"src/processing/data/query.js"}},"tables":{"type":"string","example":"orders,customers","description":"Your own table names, comma-separated, one per file in upload order, instead of t1, t2 and so on. Use letters, digits and underscores, and do not start with a digit.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More names than files, a repeated name or an invalid name -> 400.","evidence":"src/processing/data/query.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Format of the result (default csv).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Sheet to read from every file as its main table (default: the first). The other sheets of a workbook are loaded too, each under the table name followed by the sheet name.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","query"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"For to=json: { data, rows, columns, column_names, tables, truncated?, warnings? } inline. For every other format: { url, sizeBytes, rows, columns, column_names, tables, truncated?, warnings? }. `tables` lists each table the query could use: { name, also?, file, sheet, rows, columns[] }.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"tables":{"type":"array","items":{"type":"object"},"description":"Every table the query could use: { name, also?, file, sheet, rows, columns[] }."},"truncated":{"type":"boolean","description":"true when the result had more than 200,000 rows and was cut."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data","rows","columns","column_names","tables"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"rows":{"type":"integer","description":"Rows in the result."},"columns":{"type":"integer","description":"Columns in the result."},"column_names":{"type":"array","items":{"type":"string"}},"tables":{"type":"array","items":{"type":"object"},"description":"Every table the query could use: { name, also?, file, sheet, rows, columns[] }."},"truncated":{"type":"boolean","description":"true when the result had more than 200,000 rows and was cut."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","rows","columns","column_names","tables"]}],"description":"to=json -> {data}; every other format -> {url,sizeBytes} of the result file."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":20,"directFiles":20,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"data.query","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/query\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'query=SELECT country, COUNT(*) AS orders FROM t1 GROUP BY country' \\\n  -F 'tables=orders,customers' \\\n  -F 'to=xlsx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.query({\n    \"files\": 'document.pdf',\n    \"query\": \"SELECT country, COUNT(*) AS orders FROM t1 GROUP BY country\",\n    \"tables\": \"orders,customers\",\n    \"to\": \"xlsx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->query([\n    'files' => 'document.pdf',\n    'query' => 'SELECT country, COUNT(*) AS orders FROM t1 GROUP BY country',\n    'tables' => 'orders,customers',\n    'to' => 'xlsx',\n]);\necho $result->requestId;"}]}},"/v1/data/repair-json":{"post":{"operationId":"data.repair-json","summary":"Repair JSON","description":"Make broken JSON valid again: a model answer in a code fence, comments, trailing and missing commas, single quotes, unquoted keys, Python words (None, True), a cut-off ending, or several objects in a row. The answer lists every fix.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"The broken JSON as a text file. Send this or the text field.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"text":{"type":"string","example":"{'a': 1, b: None,}","description":"The broken JSON as text (instead of a file; up to 20 MB).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/data/repair-json.js"}},"output":{"type":"string","enum":["json","ndjson","compact"],"default":"json","description":"json (default: indented), compact (one line) or ndjson (one value per line).","x-davix-h2i-enum":"DataRepairJsonOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"indent":{"type":"integer","minimum":0,"maximum":8,"default":2,"description":"Spaces per level with output=json, 0 to 8 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"pick":{"type":"integer","minimum":1,"maximum":1000,"default":1,"description":"When the text holds several JSON values: which one to write, 1 to 1000 (default 1). With output=ndjson every value is written.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"sort_keys":{"type":"boolean","default":false,"description":"true: write the keys in alphabetical order. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"ascii":{"type":"boolean","default":false,"description":"true: write every non-ASCII character as a \\u escape. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"extract":{"type":"boolean","default":true,"description":"true (default): ignore a code fence and text before and after the JSON.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"comments":{"type":"boolean","default":true,"description":"true (default): remove // # and /* */ comments.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"quotes":{"type":"boolean","default":true,"description":"true (default): put bare words in quotes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"keys":{"type":"boolean","default":true,"description":"true (default): put unquoted keys in quotes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"words":{"type":"boolean","default":true,"description":"true (default): change None, True, False, undefined, NaN to null / true / false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"commas":{"type":"boolean","default":true,"description":"true (default): add missing commas.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"close":{"type":"boolean","default":true,"description":"true (default): close a cut-off ending (open quote, missing ] or }).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"many":{"type":"boolean","default":true,"description":"true (default): read several JSON values written one after another.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"strict_numbers":{"type":"boolean","default":false,"description":"true: refuse a number that is not finite (for example 1e999). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/json-repair.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, repaired, values, fixCount, fixes: [{ fix, count }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["json","ndjson"]},"repaired":{"type":"boolean","description":"false when the text was valid JSON already."},"values":{"type":"integer","description":"How many JSON values the text held."},"fixCount":{"type":"integer"},"fixes":{"type":"array","items":{"type":"object"},"description":"fix (what was changed) and count."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","repaired","values","fixCount","fixes"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.repair-json","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/repair-json\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text={'\\''a'\\'': 1, b: None,}' \\\n  -F 'output=json' \\\n  -F 'indent=2'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.repairJson({\n    \"text\": \"{'a': 1, b: None,}\",\n    \"output\": \"json\",\n    \"indent\": 2\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->repairJson([\n    'text' => '{\\'a\\': 1, b: None,}',\n    'output' => 'json',\n    'indent' => 2,\n]);\necho $result->requestId;"}]}},"/v1/data/reshape":{"post":{"operationId":"data.reshape","summary":"Reshape","description":"Turn a table around: unpivot a wide table into a long one, pivot a long table into a wide one (summing, averaging, counting ...), or transpose rows and columns.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The table to reshape (CSV, TSV, JSON, Excel, ODS ... and the other formats the data tools read).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"operation":{"type":"string","enum":["unpivot","pivot","transpose"],"default":"unpivot","description":"unpivot (default: wide to long), pivot (long to wide) or transpose.","x-davix-h2i-enum":"DataReshapeOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"id_columns":{"type":"array","example":"[\"id\",\"region\"]","items":{"type":"string"},"description":"unpivot: the columns that stay as they are, as a list or comma-separated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"value_columns":{"type":"array","example":"[\"jan\",\"feb\"]","items":{"type":"string"},"description":"unpivot: the columns to turn into rows (default: all the others).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"variable_name":{"type":"string","default":"variable","description":"unpivot: the name of the column that holds the old column names (default variable).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"value_name":{"type":"string","default":"value","description":"unpivot: the name of the column that holds the values (default value).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"skip_empty":{"type":"boolean","default":false,"description":"unpivot: leave out empty cells. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"index":{"type":"array","example":"[\"id\"]","items":{"type":"string"},"description":"pivot: the column(s) that identify a row (required for a pivot).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"pivot_column":{"type":"string","example":"month","description":"pivot: the column whose values become the new columns (required for a pivot).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"values":{"type":"array","example":"[\"amount\"]","items":{"type":"string"},"description":"pivot: the column(s) with the numbers or texts to spread (default: all the others).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"aggregate":{"type":"string","enum":["first","last","sum","mean","count","min","max","median","concat","count_distinct"],"default":"first","description":"pivot: what to do when several rows fall in one cell: first, last, sum, mean, count, min, max, median, concat, count_distinct (default first).","x-davix-h2i-enum":"DataAggregate","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"fill":{"type":"string","example":"0","description":"pivot: what to put in a cell with no row (default empty; counts give 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"sort_columns":{"type":"boolean","default":false,"description":"pivot: sort the new columns (numbers as numbers). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"column_prefix":{"type":"string","example":"m_","description":"pivot: text put before every new column name.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"separator":{"type":"string","default":", ","description":"pivot with aggregate=concat: the text between the values (default \", \").","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"totals":{"type":"boolean","default":false,"description":"pivot with sum or count: add a total column. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"total_label":{"type":"string","default":"Total","description":"The name of the total column (default Total).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"header_column":{"type":"boolean","default":true,"description":"transpose: true (default) the first column names the new columns; false: the header row becomes the first row.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"first_column_name":{"type":"string","default":"field","description":"transpose: the name of the first column of the result (default field).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/reshape.js"}},"to":{"type":"string","enum":["csv","tsv","xlsx","json","ndjson","md","html"],"default":"csv","description":"The format of the result: csv, tsv, xlsx, json, ndjson, md, html (default csv).","x-davix-h2i-enum":"DataTableTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/data/route-kit.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"id_columns":{"contentType":"application/json"},"value_columns":{"contentType":"application/json"},"index":{"contentType":"application/json"},"values":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, operation, rows, columns, rowsIn, rowsOut, columnsUnpivoted?, columnsMade?, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"operation":{"type":"string","enum":["unpivot","pivot","transpose"]},"rows":{"type":"integer"},"columns":{"type":"integer"},"rowsIn":{"type":"integer"},"rowsOut":{"type":"integer"},"columnsUnpivoted":{"type":"integer"},"columnsMade":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","operation","rows","columns","rowsIn","rowsOut"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.reshape","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/reshape\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=unpivot' \\\n  -F 'id_columns=[\"id\",\"region\"]' \\\n  -F 'value_columns=[\"jan\",\"feb\"]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.reshape({\n    \"file\": 'document.pdf',\n    \"operation\": \"unpivot\",\n    \"id_columns\": \"[\\\"id\\\",\\\"region\\\"]\",\n    \"value_columns\": \"[\\\"jan\\\",\\\"feb\\\"]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->reshape([\n    'file' => 'document.pdf',\n    'operation' => 'unpivot',\n    'id_columns' => '[\"id\",\"region\"]',\n    'value_columns' => '[\"jan\",\"feb\"]',\n]);\necho $result->requestId;"}]}},"/v1/data/split":{"post":{"operationId":"data.split","summary":"Split a data file","description":"Cut one data file into several smaller files: a set number of rows per file, a set number of files, or one file for each value of a column. Every file keeps the header row.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The data file to split.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"rows":{"type":"integer","minimum":1,"maximum":200000,"example":1000,"description":"Rows per file, for example 1000. Use this, parts or by: exactly one of the three.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"None of rows / parts / by -> 400 missing_field; more than one -> 400. More than 100 result files -> 400.","evidence":"src/processing/data/split.js"}},"parts":{"type":"integer","minimum":2,"maximum":100,"example":4,"description":"How many files to make, for example 4 for four files of about the same size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/split.js"}},"by":{"type":"string","example":"country","description":"A column name: you get one file for each different value in that column, for example one file per country.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown column, or more than 100 different values -> 400.","evidence":"src/processing/data/split.js"}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Format of the result files (default: the same as the source).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, sizeBytes, name, rows, value? }], parts, rows, columns, warnings? }. `value` is the column value of that file when splitting with `by`. With output_bundle=zip the files come as one zip (`bundle.url`).","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"name":{"type":"string","description":"A readable name for the file: the source name, then part-001 ... or the column value."},"rows":{"type":"integer"},"value":{"description":"With by: the column value all rows of this file share."}},"required":["url","sizeBytes","name","rows"]}},"parts":{"type":"integer"},"rows":{"type":"integer","description":"Rows in the source table."},"columns":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","parts","rows","columns"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.split","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/split\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'rows=1000' \\\n  -F 'parts=4' \\\n  -F 'by=country'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.split({\n    \"file\": 'document.pdf',\n    \"rows\": 1000,\n    \"parts\": 4,\n    \"by\": \"country\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->split([\n    'file' => 'document.pdf',\n    'rows' => 1000,\n    'parts' => 4,\n    'by' => 'country',\n]);\necho $result->requestId;"}]}},"/v1/data/styled-excel":{"post":{"operationId":"data.styled-excel","summary":"Styled Excel report","description":"Turn a table (CSV, JSON, Excel ...) into a finished Excel report: a title, a coloured header, striped rows, borders, number and date formats, fitted column widths, a frozen header and filter, totals as real formulas, colour scales, data bars, highlight rules and print settings.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The table to turn into a report (CSV, TSV, JSON, Excel, ODS ... and the other formats the data tools read).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"sheet_name":{"type":"string","example":"Q1 sales","description":"The name of the sheet in the report (up to 31 characters; default: the name of the sheet it came from).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"title":{"type":"string","example":"Sales report","description":"A title above the table (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"subtitle":{"type":"string","example":"January to March 2026","description":"A line under the title (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"theme":{"type":"string","enum":["blue","green","red","purple","orange","teal","dark","mono"],"default":"blue","description":"The colours: blue, green, red, purple, orange, teal, dark, mono (default blue).","x-davix-h2i-enum":"DataTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"header_color":{"type":"string","format":"color","example":"#1F4E79","description":"The header fill as a hex colour (instead of the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"header_text_color":{"type":"string","format":"color","example":"#FFFFFF","description":"The header text colour as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"zebra":{"type":"boolean","default":true,"description":"true (default): colour every second row.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"zebra_color":{"type":"string","format":"color","example":"#DDEBF7","description":"The colour of the striped rows as a hex colour (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"borders":{"type":"string","enum":["none","header","all"],"default":"all","description":"all (default: every cell), header (only the header) or none.","x-davix-h2i-enum":"DataBorders","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"freeze_header":{"type":"boolean","default":true,"description":"true (default): keep the header row in view when scrolling.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"freeze_columns":{"type":"integer","minimum":0,"maximum":10,"default":0,"description":"Keep this many columns in view when scrolling sideways, 0 to 10 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"autofilter":{"type":"boolean","default":true,"description":"true (default): filter buttons on the header.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"column_width":{"type":"string","default":"auto","example":"18","description":"auto (default: fits the longest value) or a width in characters, 4 to 100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"max_column_width":{"type":"integer","minimum":10,"maximum":100,"default":60,"description":"With auto widths: the widest a column may get, 10 to 100 (default 60).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"number_formats":{"type":"object","example":"{\"Price\":\"#,##0.00\"}","description":"An Excel number format for columns: { \"Price\": \"#,##0.00\", \"Share\": \"0.0%\" }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"date_format":{"type":"string","default":"yyyy-mm-dd","example":"dd/mm/yyyy","description":"The format of date cells (default yyyy-mm-dd).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"totals":{"type":"array","example":"[\"Price\",\"Qty\"]","items":{"type":"string"},"description":"Columns to total: a SUM formula in a row under the table.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"totals_label":{"type":"string","default":"Total","description":"The word in the first cell of the totals row (default Total).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"color_scale":{"type":"array","example":"[\"Qty\"]","items":{"type":"string"},"description":"Numeric columns to colour from low (red) to high (green).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"data_bars":{"type":"array","example":"[\"Price\"]","items":{"type":"string"},"description":"Numeric columns to show as bars inside the cells.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"highlight_rules":{"type":"array","example":"[{\"column\":\"Qty\",\"operator\":\">\",\"value\":4}]","items":{"type":"object","properties":{"column":{"type":"string"},"operator":{"type":"string"},"value":{"type":"string"},"value2":{"type":"string"},"fill":{"type":"string","format":"color","description":"Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"color":{"type":"string","format":"color","description":"Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."}},"required":["column","operator","value"]},"description":"Highlight cells: a list of { column, operator (>, >=, <, <=, =, !=, between, contains), value, value2 (between), fill, color }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"wrap_text":{"type":"boolean","default":false,"description":"true: wrap long text inside cells. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"font":{"type":"string","default":"Calibri","description":"The font (default Calibri).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"font_size":{"type":"integer","minimum":6,"maximum":40,"default":11,"description":"The font size in points, 6 to 40 (default 11).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"header_height":{"type":"number","minimum":10,"maximum":120,"default":24,"description":"The height of the header row in points, 10 to 120 (default 24).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"as_table":{"type":"boolean","default":false,"description":"true: make an Excel table (with its own style, filter and banding) instead of styling cells by hand. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"table_style":{"type":"string","default":"TableStyleMedium2","example":"TableStyleLight9","description":"With as_table: an Excel table style such as TableStyleMedium2 (default), TableStyleLight9, TableStyleDark3.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"orientation":{"type":"string","enum":["auto","portrait","landscape"],"default":"auto","description":"Print orientation: auto (default: landscape for more than 6 columns), portrait or landscape.","x-davix-h2i-enum":"Orientation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"repeat_header":{"type":"boolean","default":true,"description":"true (default): repeat the header row on every printed page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"author":{"type":"string","example":"Finance team","description":"The author written into the file properties.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/styled-excel.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"number_formats":{"contentType":"application/json"},"totals":{"contentType":"application/json"},"color_scale":{"contentType":"application/json"},"data_bars":{"contentType":"application/json"},"highlight_rules":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, sheet, theme, rows, columns, headerRow, firstDataRow, lastDataRow, totalsRow, formulas, conditionalFormats, orientation, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["xlsx"]},"sheet":{"type":"string"},"theme":{"type":"string"},"rows":{"type":"integer"},"columns":{"type":"integer"},"headerRow":{"type":"integer","description":"The row of the header (after the title and subtitle)."},"firstDataRow":{"type":"integer"},"lastDataRow":{"type":"integer"},"totalsRow":{"type":"integer","description":"The row of the totals, or null."},"formulas":{"type":"integer"},"conditionalFormats":{"type":"integer"},"orientation":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","sheet","theme","rows","columns","headerRow","firstDataRow","lastDataRow","formulas","conditionalFormats","orientation"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.styled-excel","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/styled-excel\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'sheet_name=Q1 sales' \\\n  -F 'title=Sales report' \\\n  -F 'subtitle=January to March 2026'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.styledExcel({\n    \"file\": 'document.pdf',\n    \"sheet_name\": \"Q1 sales\",\n    \"title\": \"Sales report\",\n    \"subtitle\": \"January to March 2026\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->styledExcel([\n    'file' => 'document.pdf',\n    'sheet_name' => 'Q1 sales',\n    'title' => 'Sales report',\n    'subtitle' => 'January to March 2026',\n]);\necho $result->requestId;"}]}},"/v1/data/transform":{"post":{"operationId":"data.transform","summary":"Transform a data file with a list of operations","description":"Apply a declarative list of operations (select, drop, rename, filter, sort, limit, offset, set, cast, dedupe) to a table and write it in any format. No expressions or code: only the fixed operations.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The source file.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"to":{"type":"string","enum":["xlsx","ods","md","html","xls","csv","json","xml","tsv","ndjson","yaml","toml","sql"],"description":"Target format (default: the same as the source).","x-davix-h2i-enum":"DataTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"A format the plan does not include -> 403 format_not_allowed.","evidence":"src/api/data/shared.js"}},"operations":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["select","drop","rename","filter","sort","limit","offset","set","cast","dedupe"],"x-davix-h2i-enum":"DataOp"}},"required":["op"],"additionalProperties":true},"description":"The operations, run in order: [{\"op\":\"filter\",\"where\":{\"column\":\"age\",\"op\":\"gte\",\"value\":18}},{\"op\":\"set\",\"column\":\"name_upper\",\"from\":\"name\",\"fn\":\"upper\"},{\"op\":\"sort\",\"by\":\"age\"},{\"op\":\"select\",\"columns\":[\"name\",\"age\"]}]. set takes one of value, template (\"{first} {last}\"), concat, from + fn (upper lower trim string number boolean length abs round floor ceil date), add, multiply.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"At most 100 operations. An unknown operation, operator or column -> 400 (details.allowed / details.available).","evidence":"src/processing/data/ops.js"}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent JSON output; false writes it compact.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are written: iso (default), date, datetime, unix, excel, or a pattern made of YYYY MM DD HH mm ss and separators, e.g. DD/MM/YYYY.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400.","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"columns":{"type":"string","description":"Keep only these columns, in this order (comma-separated or a JSON array). Applied after filter, sort and limit.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown column -> 400 (details.available).","evidence":"src/processing/data/codecs.js"}},"filter":{"type":"string","description":"Keep only rows matching a condition: JSON like {\"column\":\"age\",\"op\":\"gte\",\"value\":18}, an array (all must match), or {\"and\":[...]} / {\"or\":[...]} / {\"not\":{...}}. Operators: eq ne gt gte lt lte in nin contains startswith endswith like empty notempty.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"No regular expressions or code: only these operators.","evidence":"src/processing/data/codecs.js"}},"sort":{"type":"string","description":"Sort rows: comma-separated columns, each optionally :asc or :desc (e.g. \"country,age:desc\"). Empty values sort last.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"limit":{"type":"integer","minimum":0,"maximum":200000,"description":"Keep only the first N rows (after filter and sort).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"formula_safe":{"type":"boolean","default":false,"description":"true: prefix CSV/TSV cells that a spreadsheet would run as a formula (= + - @) with an apostrophe.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rootName":{"type":"string","description":"XML output: the root element name (default rows for tables). Invalid characters are replaced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"rowName":{"type":"string","description":"XML output: the element used for each row (default row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"table":{"type":"string","description":"SQL output: table name (default: the sheet name). SQLite input: read only this table (default: all tables).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"operations":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Same as POST /v1/data/convert: {data} for to=json, otherwise {url, sizeBytes}; rows and warnings are added.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{},"rows":{"type":"integer","nullable":true,"description":"Rows written (tables)."},"warnings":{"type":"array","items":{"type":"string"},"description":"What the conversion had to do: flattened keys, a fallback encoding, sheets that were not written ..."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["data"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"rows":{"type":"integer","nullable":true,"description":"Rows written (tables)."},"warnings":{"type":"array","items":{"type":"string"},"description":"What the conversion had to do: flattened keys, a fallback encoding, sheets that were not written ..."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes"]}],"description":"to=json -> {data}; every other target -> {url,sizeBytes} of the converted file."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.transform","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/transform\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'to=xlsx' \\\n  -F 'limit=0' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.transform({\n    \"file\": 'document.pdf',\n    \"to\": \"xlsx\",\n    \"limit\": 0,\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->transform([\n    'file' => 'document.pdf',\n    'to' => 'xlsx',\n    'limit' => 0,\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/data/validate":{"post":{"operationId":"data.validate","summary":"Validate a data file against a JSON Schema","description":"Check every row of a table (or the whole document) against a JSON Schema and list what is wrong: which row, which field, which rule. The file is never changed. Only local $ref references are followed; nothing is fetched.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The data file to check.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Limits: at most 200,000 rows and 2,000 columns per sheet, 100 sheets; JSON/YAML nesting up to 50 levels; XML input up to 20 MB. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"schema":{"type":"string","description":"The JSON Schema (draft-07 / 2019-09 / 2020-12 keywords), as JSON text, up to 1 MB. Formats such as email, uri, date and uuid are checked.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, an invalid schema or a remote $ref -> 400. A pattern that takes more than 15 s to evaluate stops the check (400 validation_timeout).","evidence":"src/processing/data/analysis.js"}},"target":{"type":"string","enum":["auto","rows","document"],"default":"auto","description":"rows: each record is checked on its own; document: the whole file is one instance; auto (default): rows for tables and top-level arrays, document otherwise.","x-davix-h2i-enum":"DataTarget","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"sheet":{"type":"string","description":"Sheet / table to check (default: the first).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"dateFormat":{"type":"string","description":"How dates are presented to the schema (default iso).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"Whether the first row of text tables holds column names (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","schema"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ valid, target, checked, invalid, errors: [{ row?, path, keyword, message, ... }], truncated } — at most 100 errors are listed.","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"target":{"type":"string","enum":["rows","document"]},"checked":{"type":"integer"},"invalid":{"type":"integer"},"errors":{"type":"array","items":{"type":"object"},"description":"At most 100 problems: row (rows), path, keyword, message, and allowed / missing where known."},"truncated":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["valid","target","checked","invalid","errors","truncated"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.validate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/validate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'schema=example' \\\n  -F 'target=auto' \\\n  -F 'sheet=example'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.validate({\n    \"file\": 'document.pdf',\n    \"schema\": \"example\",\n    \"target\": \"auto\",\n    \"sheet\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->validate([\n    'file' => 'document.pdf',\n    'schema' => 'example',\n    'target' => 'auto',\n    'sheet' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/data/validate-fields":{"post":{"operationId":"data.validate-fields","summary":"Validate contact fields","description":"Check columns of a table as e-mail addresses, phone numbers, web addresses, IBANs, BICs, card numbers, VAT numbers, postal codes, IP addresses, dates, UUIDs, ISBNs or colours (shape and check digits, nothing is looked up online); add a valid flag and a reason, rewrite values in their standard form, or keep only the good or bad rows.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The table to check (CSV, TSV, JSON, Excel, ODS ... and the other formats the data tools read).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"sheet":{"type":"string","description":"Worksheet / table name to read or write (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"fields":{"type":"object","example":"{\"Email\":\"email\",\"Phone\":\"phone\"}","description":"Which columns to check and as what: { \"Email\": \"email\", \"Phone\": \"phone\" }, a list such as [\"Email:email\"], or comma-separated. Types: email, phone, url, iban, bic, card, vat, postal, ip, ipv4, ipv6, date, uuid, isbn, color. A field can carry its own country: { \"Zip\": { \"type\": \"postal\", \"country\": \"DE\" } }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"country":{"type":"string","example":"DE","description":"The two-letter country for phone numbers, postal codes and VAT numbers written without one (for example DE).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"filter":{"type":"string","enum":["all","valid","invalid"],"default":"all","description":"all (default), valid (only rows that passed) or invalid (only rows that failed).","x-davix-h2i-enum":"DataFilter","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"require":{"type":"string","enum":["all","any"],"default":"all","description":"all (default: every checked field must be valid for a row to pass) or any (one valid field is enough).","x-davix-h2i-enum":"DataRequire","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"normalize":{"type":"boolean","default":false,"description":"true: write the valid values in their standard form (phone as +4930123456, IBAN without spaces, host in lower case). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"add_flags":{"type":"boolean","default":true,"description":"true (default): a column name_valid with true / false for every checked column.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"add_reasons":{"type":"boolean","default":true,"description":"true (default): a column name_reason saying why a value failed.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"valid_suffix":{"type":"string","default":"_valid","description":"The end of the flag column names (default _valid).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"reason_suffix":{"type":"string","default":"_reason","description":"The end of the reason column names (default _reason).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"row_column":{"type":"string","example":"row_ok","description":"Add a column with this name that is true when the whole row passed.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"empty_is_valid":{"type":"boolean","default":true,"description":"true (default): an empty cell passes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"trim":{"type":"boolean","default":true,"description":"true (default): spaces around a value are ignored. false: they make it invalid.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"assume_https":{"type":"boolean","default":false,"description":"true: a web address without a scheme is read as https://. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"allow_local_email":{"type":"boolean","default":false,"description":"true: an address such as me@localhost passes. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"dedupe":{"type":"boolean","default":false,"description":"true: keep only the first of rows with the same checked values (case does not matter). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/validate-fields.js"}},"to":{"type":"string","enum":["csv","tsv","xlsx","json","ndjson","md","html"],"default":"csv","description":"The format of the result: csv, tsv, xlsx, json, ndjson, md, html (default csv).","x-davix-h2i-enum":"DataTableTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/data/route-kit.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","fields"]},"encoding":{"fields":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, rows, valid, invalid, kept, fields: [{ column, type, checked, valid, invalid, empty }], warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"rows":{"type":"integer"},"valid":{"type":"integer","description":"Rows that passed."},"invalid":{"type":"integer"},"kept":{"type":"integer","description":"Rows in the result after filter and dedupe."},"fields":{"type":"array","items":{"type":"object"},"description":"For each checked column: type, checked, valid, invalid, empty."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","rows","valid","invalid","kept","fields"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"data.validate-fields","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/validate-fields\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'fields={\"Email\":\"email\",\"Phone\":\"phone\"}' \\\n  -F 'country=DE' \\\n  -F 'filter=all'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.validateFields({\n    \"file\": 'document.pdf',\n    \"fields\": \"{\\\"Email\\\":\\\"email\\\",\\\"Phone\\\":\\\"phone\\\"}\",\n    \"country\": \"DE\",\n    \"filter\": \"all\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->validateFields([\n    'file' => 'document.pdf',\n    'fields' => '{\"Email\":\"email\",\"Phone\":\"phone\"}',\n    'country' => 'DE',\n    'filter' => 'all',\n]);\necho $result->requestId;"}]}},"/v1/data/workbooks":{"post":{"operationId":"data.workbooks","summary":"Split / combine workbooks","description":"Split a workbook into one file per sheet (xlsx, csv, json ...) in a ZIP, or combine several workbooks and table files into one workbook with a sheet for each, or stack all their rows into one sheet.","tags":["Data"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The workbooks or table files (Excel, ODS, CSV, JSON ...).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"operation":{"type":"string","enum":["split","combine"],"default":"split","description":"split (default: a file per sheet) or combine (one workbook).","x-davix-h2i-enum":"DataWorkbooksOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"sheets":{"type":"array","example":"[\"Jan\",\"3\"]","items":{"type":"string"},"description":"Only these sheets: names or 1-based numbers, as a list or comma-separated (default: every sheet).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"format":{"type":"string","enum":["xlsx","csv","tsv","json","ndjson","md","html"],"default":"xlsx","description":"split: the format of each file: xlsx (default), csv, tsv, json, ndjson, md or html.","x-davix-h2i-enum":"DataWorkbooksFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"name_by":{"type":"string","enum":["sheet","file-sheet","index"],"default":"sheet","description":"split: name the files by sheet (default), file-sheet (book-Jan) or index (01, 02 ...).","x-davix-h2i-enum":"DataNameBy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"prefix":{"type":"string","example":"q1-","description":"split: text put before every file name (up to 40 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"skip_empty":{"type":"boolean","default":false,"description":"split: leave out sheets that have no rows. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"mode":{"type":"string","enum":["sheets","append"],"default":"sheets","description":"combine: sheets (default: every sheet stays a sheet) or append (all rows stacked into one sheet).","x-davix-h2i-enum":"DataWorkbooksMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"sheet_names":{"type":"string","enum":["auto","sheet","file","file-sheet"],"default":"auto","description":"combine with sheets: how the sheets are named: auto (default: the sheet name, with the file name added when two are alike), sheet, file or file-sheet.","x-davix-h2i-enum":"DataSheetNames","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"columns":{"type":"string","enum":["all","common"],"default":"all","description":"combine with append: all (default: the union of the columns, blanks where missing) or common (only columns every sheet has).","x-davix-h2i-enum":"DataColumns","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"source_column":{"type":"string","example":"source","description":"combine with append: add a column with this name saying which file (and sheet) a row came from.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"sheet_name":{"type":"string","default":"Combined","description":"combine with append: the name of the sheet (default Combined).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"to":{"type":"string","enum":["xlsx","csv","json"],"default":"xlsx","description":"combine: xlsx (default), csv (only with append) or json.","x-davix-h2i-enum":"DataWorkbooksTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/workbooks.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"sheets":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"split: { operation, url, sizeBytes, format, files, entries: [{ file, sheet, source, rows, columns, bytes }], warnings? }. combine: { operation, url, sizeBytes, format, mode, sheets, rows, entries: [{ file, sheet, as?, rows }], warnings? }.","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","enum":["split","combine"]},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"files":{"type":"integer","description":"split: how many files are in the ZIP."},"entries":{"type":"array","items":{"type":"object"},"description":"split: file (the name in the ZIP), sheet, source, rows, columns, bytes. combine: file, sheet, as (the sheet name in the result), rows."},"mode":{"type":"string"},"sheets":{"type":"integer"},"rows":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["operation","url","sizeBytes","format","entries"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","data_conversion_failed","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"data.workbooks","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"data","rateLimitCategory":"data","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/data/workbooks\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'operation=split' \\\n  -F 'sheets=[\"Jan\",\"3\"]' \\\n  -F 'format=xlsx'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.data.workbooks({\n    \"files\": 'document.pdf',\n    \"operation\": \"split\",\n    \"sheets\": \"[\\\"Jan\\\",\\\"3\\\"]\",\n    \"format\": \"xlsx\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->data()->workbooks([\n    'files' => 'document.pdf',\n    'operation' => 'split',\n    'sheets' => '[\"Jan\",\"3\"]',\n    'format' => 'xlsx',\n]);\necho $result->requestId;"}]}},"/v1/documents/accessibility":{"post":{"operationId":"documents.accessibility","summary":"Accessibility audit","description":"Check an HTML page or fragment against about thirty WCAG 2.1 (A and AA) rules: images, forms, links, headings, tables, media, ARIA, keyboard and colour contrast, with the element, the criterion and what to do.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"An HTML file, instead of the html parameter.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"html":{"type":"string","example":"<img src=\"a.png\"><button></button>","description":"The HTML (up to 5,000,000 characters), instead of a file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"level":{"type":"string","enum":["A","AA","AAA"],"default":"AA","description":"The WCAG level to check: A, AA (default) or AAA (the rules of A and AA; there are no AAA-only rules yet).","x-davix-h2i-enum":"DocumentsAccessibilityLevel","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"min_impact":{"type":"string","enum":["minor","moderate","serious","critical"],"default":"minor","description":"Report only issues of this impact or higher: minor (default), moderate, serious or critical.","x-davix-h2i-enum":"DocumentsMinImpact","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"only":{"type":"array","example":"[\"image-alt\",\"link-name\"]","items":{"type":"string"},"description":"Check only these rules (default: all). Rule ids: html-lang, document-title, image-alt, input-label, button-name, link-name, heading-order, color-contrast, ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"skip":{"type":"array","example":"[\"image-alt\",\"link-name\"]","items":{"type":"string"},"description":"Leave these rules out.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"fragment":{"type":"boolean","default":false,"description":"true: the HTML is a piece of a page: leave out the checks that need a whole page (lang, title, h1, main landmark, skip link, viewport). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"include_passed":{"type":"boolean","default":false,"description":"true: also list the rules that found nothing (passed). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"include_snippet":{"type":"boolean","default":true,"description":"true (default): give the HTML of the element with every issue.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"include_selector":{"type":"boolean","default":true,"description":"true (default): give a CSS selector of the element with every issue.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"max_issues":{"type":"integer","minimum":1,"maximum":2000,"default":200,"description":"The most issues to list, 1 to 2000 (default 200). The counts are always complete.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/accessibility.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"only":{"contentType":"application/json"},"skip":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ score, grade, total, counts, issues: [{ rule, impact, wcag, level, message, help, selector?, snippet?, ratio?, required? }], truncated, byRule, rulesChecked, passed?, limits }","content":{"application/json":{"schema":{"type":"object","properties":{"score":{"type":"integer","description":"From 0 to 100: 100 minus a weighted penalty for the issues found."},"grade":{"type":"string","enum":["A","B","C","D","F"]},"total":{"type":"integer"},"counts":{"type":"object","description":"The number of issues of each impact: critical, serious, moderate, minor."},"issues":{"type":"array","items":{"type":"object"},"description":"Each issue: rule, impact, wcag (success criterion), level, message, help, and selector and snippet of the element."},"truncated":{"type":"boolean"},"byRule":{"type":"array","items":{"type":"object"},"description":"For every rule that found something: rule, count, impact, wcag."},"rulesChecked":{"type":"integer"},"passed":{"type":"array","items":{"type":"object"},"description":"With include_passed: the rules that found nothing."},"limits":{"type":"array","items":{"type":"string"},"description":"What this check cannot see (styles from style sheets, scripts, reading order)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["score","grade","total","counts","issues","truncated","byRule","rulesChecked","limits"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.accessibility","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/accessibility\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'html=<img src=\"a.png\"><button></button>' \\\n  -F 'level=AA' \\\n  -F 'min_impact=minor'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.accessibility({\n    \"html\": \"<img src=\\\"a.png\\\"><button></button>\",\n    \"level\": \"AA\",\n    \"min_impact\": \"minor\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->accessibility([\n    'html' => '<img src=\"a.png\"><button></button>',\n    'level' => 'AA',\n    'min_impact' => 'minor',\n]);\necho $result->requestId;"}]}},"/v1/documents/archive-create":{"post":{"operationId":"documents.archive-create","summary":"Create a ZIP","description":"Put files into one ZIP archive. Choose the names inside the ZIP, an optional folder and how hard to compress.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The files to put in the ZIP, in order. Any type.","x-davix-h2i-file":{"note":"Any file type. The number of files and the size limits are plan/settings limits (runtime)."}},"names":{"type":"array","example":"[\"a.txt\",\"docs/b.txt\"]","items":{"type":"string"},"description":"The name of each file inside the ZIP, a JSON list in the same order as files (a name can include folders, for example docs/readme.txt). Default: each file's own name. Two files with the same name get \"(1)\", \"(2)\".","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A different number of names than files -> 400. A name with .., a leading / or a drive letter -> 400.","evidence":"src/api/pdfs/documents-archives.js"}},"folder":{"type":"string","example":"export-2026","description":"Put everything inside this folder in the ZIP, for example \"export-2026\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-archives.js"}},"level":{"type":"integer","minimum":0,"maximum":9,"default":6,"description":"Compression: 0 (store, no compression) to 9 (smallest). Default 6.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-archives.js"}},"comment":{"type":"string","maxLength":2000,"description":"A comment saved in the ZIP (up to 2000 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-archives.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"names":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format: \"zip\", fileCount, entries, uncompressedBytes, ratio }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"fileCount":{"type":"integer"},"entries":{"type":"array","items":{"type":"string"},"description":"The names of the files inside the ZIP."},"uncompressedBytes":{"type":"integer"},"ratio":{"type":"number","description":"ZIP size divided by the original size (smaller is better)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","fileCount","entries","uncompressedBytes","ratio"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"documents.archive-create","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/archive-create\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'names=[\"a.txt\",\"docs/b.txt\"]' \\\n  -F 'folder=export-2026' \\\n  -F 'level=6'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.archiveCreate({\n    \"files\": 'document.pdf',\n    \"names\": \"[\\\"a.txt\\\",\\\"docs/b.txt\\\"]\",\n    \"folder\": \"export-2026\",\n    \"level\": 6\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->archiveCreate([\n    'files' => 'document.pdf',\n    'names' => '[\"a.txt\",\"docs/b.txt\"]',\n    'folder' => 'export-2026',\n    'level' => 6,\n]);\necho $result->requestId;"}]}},"/v1/documents/archive-extract":{"post":{"operationId":"documents.archive-extract","summary":"Extract an archive","description":"Open a ZIP, TAR, TAR.GZ, RAR or 7z and get its files back, one download each. Safe by design: entries that try to escape, links and password-protected entries are skipped, and archives that expand absurdly are refused.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The archive: ZIP, TAR, TAR.GZ (.tgz), RAR or 7z.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool reads it as an archive and answers 400 invalid_upload when it is not one. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"include":{"type":"array","example":"[\"*.png\"]","items":{"type":"string"},"description":"Only extract files that match these patterns, a list such as [\"*.png\",\"docs/**\"]. * matches within a folder, ** across folders. A pattern with no / matches the file name anywhere. Default: everything.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-archives.js"}},"exclude":{"type":"array","example":"[\"__MACOSX/**\"]","items":{"type":"string"},"description":"Skip files that match these patterns (same rules as include).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-archives.js"}},"max_files":{"type":"integer","minimum":1,"maximum":1000,"default":200,"description":"Extract at most this many files (default 200, up to 1000). The answer says when there were more.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-archives.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"include":{"contentType":"application/json"},"exclude":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ fileCount, totalSizeBytes, results: [{ url, sizeBytes, name, path, modified }], skipped?, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","enum":["zip","tar","tar.gz","rar","7z"],"description":"The kind of archive that was opened."},"fileCount":{"type":"integer"},"totalSizeBytes":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"name":{"type":"string","description":"The file name (the last part of its path)."},"path":{"type":"string","description":"The path of the file inside the ZIP."},"modified":{"type":"string"}},"required":["url","sizeBytes","name","path"]}},"skipped":{"type":"object","description":"How many entries were skipped and why: unsafePath, links, encrypted, excluded."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["format","fileCount","totalSizeBytes","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.archive-extract","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/archive-extract\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'include=[\"*.png\"]' \\\n  -F 'exclude=[\"__MACOSX/**\"]' \\\n  -F 'max_files=200'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.archiveExtract({\n    \"file\": 'document.pdf',\n    \"include\": \"[\\\"*.png\\\"]\",\n    \"exclude\": \"[\\\"__MACOSX/**\\\"]\",\n    \"max_files\": 200\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->archiveExtract([\n    'file' => 'document.pdf',\n    'include' => '[\"*.png\"]',\n    'exclude' => '[\"__MACOSX/**\"]',\n    'max_files' => 200,\n]);\necho $result->requestId;"}]}},"/v1/documents/archive-inspect":{"post":{"operationId":"documents.archive-inspect","summary":"Inspect an archive","description":"See what is inside a ZIP, TAR, TAR.GZ, RAR or 7z without extracting it: every entry with its size and date, the totals, and a safety check for path escapes, links, programs, nested archives and zip bombs.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The archive: ZIP, TAR, TAR.GZ (TGZ), RAR or 7z.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool reads it as an archive and answers 400 invalid_upload when it is not one. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"limit":{"type":"integer","minimum":1,"maximum":5000,"default":500,"description":"List at most this many entries (default 500, up to 5000). The totals always cover every entry.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-archives.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ format, archiveSizeBytes, entryCount, fileCount, directoryCount, totalSizeBytes, ratio, safe, risks, byType, entries, truncated, comment? }","content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","description":"zip, tar, tar.gz, rar or 7z."},"archiveSizeBytes":{"type":"integer"},"entryCount":{"type":"integer"},"fileCount":{"type":"integer"},"directoryCount":{"type":"integer"},"totalSizeBytes":{"type":"integer","description":"All entries added up, as they would be once extracted."},"ratio":{"type":"number","description":"Extracted size divided by the archive size."},"safe":{"type":"boolean","description":"false when a high-risk problem was found (unsafe paths, a zip bomb)."},"risks":{"type":"array","items":{"type":"object"},"description":"What was found: code, severity (high, medium, info), message, count and examples."},"byType":{"type":"object","description":"How many files of each extension."},"entries":{"type":"array","items":{"type":"object"},"description":"One per entry: name, type (file, directory, link), sizeBytes, compressedBytes, modified, method, encrypted?, comment?."},"truncated":{"type":"boolean"},"comment":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["format","archiveSizeBytes","entryCount","fileCount","directoryCount","totalSizeBytes","ratio","safe","risks","byType","entries","truncated"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.archive-inspect","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/archive-inspect\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'limit=500' \\\n  -F 'validate_only=false' \\\n  -F 'presetId=00000000-0000-4000-8000-000000000000'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.archiveInspect({\n    \"file\": 'document.pdf',\n    \"limit\": 500,\n    \"validate_only\": false,\n    \"presetId\": \"00000000-0000-4000-8000-000000000000\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->archiveInspect([\n    'file' => 'document.pdf',\n    'limit' => 500,\n    'validate_only' => false,\n    'presetId' => '00000000-0000-4000-8000-000000000000',\n]);\necho $result->requestId;"}]}},"/v1/documents/archive-protect":{"post":{"operationId":"documents.archive-protect","summary":"Password ZIP","description":"Pack files into a ZIP that needs a password to open: WinZip AES-256 (default), AES-192, AES-128, or classic ZipCrypto for programs that cannot read AES.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The files to put in the ZIP.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"password":{"type":"string","example":"correct horse battery staple","description":"The password, 1 to 256 characters. It is used to lock the ZIP and is never stored or logged.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/archives/protect.js"}},"encryption":{"type":"string","enum":["aes256","aes192","aes128","zipcrypto"],"default":"aes256","description":"aes256 (default), aes192, aes128 or zipcrypto. AES opens in 7-Zip, WinZip, Keka, The Unarchiver and Bandizip, not in Windows Explorer or macOS Archive Utility; ZipCrypto opens everywhere but is weak.","x-davix-h2i-enum":"DocumentsEncryption","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/archives/protect.js"}},"compression":{"type":"string","enum":["deflate","store"],"default":"deflate","description":"deflate (default) or store (no compression, for files that are already compressed).","x-davix-h2i-enum":"DocumentsCompression","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/archives/protect.js"}},"level":{"type":"integer","minimum":1,"maximum":9,"default":6,"description":"Deflate level, 1 (fast) to 9 (small); default 6.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/archives/protect.js"}},"names":{"type":"array","example":"[\"report.pdf\",\"data/table.csv\"]","items":{"type":"string"},"description":"The names of the files inside the ZIP, in the order of the files (default: the file names). Safe paths only: no \"..\", no leading \"/\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/archives/protect.js"}},"folder":{"type":"string","example":"documents","description":"Put every file in this folder inside the ZIP.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/archives/protect.js"}},"sort":{"type":"boolean","default":false,"description":"true: list the files by name. Default false (the order they were sent).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/archives/protect.js"}},"comment":{"type":"string","example":"Contracts 2026","description":"A comment stored in the ZIP (up to 500 characters). It is not encrypted.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/archives/protect.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files","password"]},"encoding":{"names":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, encryption, compression, entries, files: [{ name, size, compressedSize, method }], namesVisible, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["zip"]},"encryption":{"type":"string","enum":["aes256","aes192","aes128","zipcrypto"]},"compression":{"type":"string","enum":["deflate","store"]},"entries":{"type":"integer"},"files":{"type":"array","items":{"type":"object"},"description":"Each file: name, size, compressedSize (with the encryption overhead) and method (deflate or store)."},"namesVisible":{"type":"boolean","description":"Always true: the ZIP format cannot hide file names."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","encryption","compression","entries","files","namesVisible"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"documents.archive-protect","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/archive-protect\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'password=correct horse battery staple' \\\n  -F 'encryption=aes256' \\\n  -F 'compression=deflate'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.archiveProtect({\n    \"files\": 'document.pdf',\n    \"password\": \"correct horse battery staple\",\n    \"encryption\": \"aes256\",\n    \"compression\": \"deflate\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->archiveProtect([\n    'files' => 'document.pdf',\n    'password' => 'correct horse battery staple',\n    'encryption' => 'aes256',\n    'compression' => 'deflate',\n]);\necho $result->requestId;"}]}},"/v1/documents/checksum":{"post":{"operationId":"documents.checksum","summary":"Checksum","description":"The checksums of one or more files (MD5, SHA-1, SHA-2, SHA-3, BLAKE2, CRC-32, Adler-32), several at once, checked against a hash you already have, with an optional manifest in the sha256sum style.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The files to hash.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"algorithms":{"type":"array","example":"[\"sha256\",\"md5\"]","items":{"type":"string"},"description":"Which hashes, as a list or comma-separated (default sha256): md5, sha1, sha224, sha256, sha384, sha512, sha512-256, sha3-256, sha3-384, sha3-512, blake2b512, blake2s256, ripemd160, crc32, adler32.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/checksum.js"}},"encoding":{"type":"string","enum":["hex","base64","base64url"],"default":"hex","description":"hex (default), base64 or base64url.","x-davix-h2i-enum":"DocumentsEncoding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/checksum.js"}},"uppercase":{"type":"boolean","default":false,"description":"true: write hex digits in capitals. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/checksum.js"}},"expected":{"type":"string","example":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","description":"A hash you already have, to compare with the first file (the algorithm is found from its length), or a map of file name to hash for several files (sent as an object).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/checksum.js"}},"expected_algorithm":{"type":"string","example":"sha256","description":"Which algorithm `expected` is made with, when its length fits several (a 64-digit hash can be SHA-256, SHA3-256 or BLAKE2s).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/checksum.js"}},"include_size":{"type":"boolean","default":true,"description":"true (default): give the size in bytes of every file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/checksum.js"}},"manifest":{"type":"string","enum":["none","gnu","bsd","json"],"default":"none","description":"Also make a file listing every hash: gnu (sha256sum style, \"hash  name\"), bsd (\"SHA256 (name) = hash\"), a data file with the list (format json) or none (default).","x-davix-h2i-enum":"DocumentsManifest","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/checksum.js"}},"manifest_algorithm":{"type":"string","example":"sha256","description":"The algorithm used in the manifest (default: the first of algorithms).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/checksum.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"algorithms":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ name, sizeBytes?, hashes, expected?, verified?, matchedAlgorithm?, note? }], algorithms, allVerified?, manifestUrl?, manifestBytes?, manifestFormat? }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"sizeBytes":{"type":"integer"},"hashes":{"type":"object","description":"One entry per algorithm: { sha256: \"...\" }."},"expected":{"type":"string"},"verified":{"type":"boolean","description":"true when the expected hash matches (only when expected was given)."},"matchedAlgorithm":{"type":"string"},"note":{"type":"string"}},"required":["name","hashes"]}},"algorithms":{"type":"array","items":{"type":"string"}},"allVerified":{"type":"boolean"},"manifestUrl":{"type":"string","format":"uri"},"manifestBytes":{"type":"integer"},"manifestFormat":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","algorithms"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"documents.checksum","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/checksum\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'algorithms=[\"sha256\",\"md5\"]' \\\n  -F 'encoding=hex' \\\n  -F 'expected=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.checksum({\n    \"files\": 'document.pdf',\n    \"algorithms\": \"[\\\"sha256\\\",\\\"md5\\\"]\",\n    \"encoding\": \"hex\",\n    \"expected\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->checksum([\n    'files' => 'document.pdf',\n    'algorithms' => '[\"sha256\",\"md5\"]',\n    'encoding' => 'hex',\n    'expected' => 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',\n]);\necho $result->requestId;"}]}},"/v1/documents/citations":{"post":{"operationId":"documents.citations","summary":"Citation generator","description":"Make a bibliography (and in-text citations) in APA 7, MLA 9, Chicago (author-date), Harvard, IEEE or Vancouver from a list of sources or a BibTeX, RIS or CSL-JSON file; or convert the sources to BibTeX, RIS or CSL-JSON. Nothing is looked up online.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"A BibTeX (.bib), RIS (.ris) or CSL-JSON (.json) file of sources. Send this or the sources field.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"sources":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"authors":{"type":"array","items":{}},"year":{"type":"integer"},"container":{"type":"string"},"publisher":{"type":"string"},"doi":{"type":"string"},"url":{"type":"string"}},"required":["title"]},"description":"The sources: a list of { type (article, book, chapter, conference, report, thesis, website, newspaper), title, authors (\"Family, Given\" or { family, given }), year (or date), container (journal, site or book title), publisher, place, volume, issue, pages, edition, doi, url, accessed, editors, id }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-citations.js"}},"style":{"type":"string","enum":["apa","mla","chicago","harvard","ieee","vancouver"],"default":"apa","description":"The citation style: apa, mla, chicago, harvard, ieee, vancouver (default apa).","x-davix-h2i-enum":"DocumentsStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"output":{"type":"string","enum":["text","html","markdown","bibtex","ris","csl-json"],"default":"text","description":"text (default), html, markdown (italics kept), or bibtex, ris, csl-json to convert the sources.","x-davix-h2i-enum":"DocumentsCitationsOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"sort":{"type":"string","enum":["alphabetical","given"],"description":"alphabetical (default; the order you gave for IEEE and Vancouver) or given (keep your order).","x-davix-h2i-enum":"DocumentsCitationsSort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"import_format":{"type":"string","enum":["auto","json","bibtex","ris","csl-json"],"default":"auto","description":"The format of the uploaded file: auto (default; from the name and the content), json, bibtex, ris or csl-json.","x-davix-h2i-enum":"DocumentsImportFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"in_text":{"type":"boolean","default":false,"description":"true: also give the in-text citation of every source, such as (Smith, 2020). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"numbered":{"type":"boolean","description":"Number the entries (default: true for IEEE and Vancouver, false for the others).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"max_authors":{"type":"integer","minimum":1,"maximum":100,"description":"Show at most this many authors before \"et al.\" (default: the rule of the style), 1 to 100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"doi_as_url":{"type":"boolean","default":true,"description":"true (default): write a DOI as https://doi.org/... ; false: doi:...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"include_access_date":{"type":"boolean","default":false,"description":"true: add \"Accessed ...\" to web sources that have an accessed date (MLA, Chicago, Harvard). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/citations.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"sources":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ style, output, count, entries: [{ id, type, citation?, inText? }], text, warnings, url, sizeBytes, format }","content":{"application/json":{"schema":{"type":"object","properties":{"style":{"type":"string"},"output":{"type":"string"},"count":{"type":"integer"},"entries":{"type":"array","items":{"type":"object"},"description":"One per source: id, type, citation and, with in_text, inText."},"text":{"type":"string","description":"The whole bibliography (or the converted file)."},"warnings":{"type":"array","items":{"type":"string"},"description":"Fields a style needs that a source lacks."},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["style","output","count","entries","text","warnings","url","sizeBytes","format"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.citations","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/citations\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'style=apa' \\\n  -F 'output=text' \\\n  -F 'sort=alphabetical'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.citations({\n    \"style\": \"apa\",\n    \"output\": \"text\",\n    \"sort\": \"alphabetical\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->citations([\n    'style' => 'apa',\n    'output' => 'text',\n    'sort' => 'alphabetical',\n]);\necho $result->requestId;"}]}},"/v1/documents/clean-html":{"post":{"operationId":"documents.clean-html","summary":"Clean HTML","description":"Make untidy or untrusted HTML safe and tidy (or take out the article text, plain text or Markdown): an allow-list of tags and attributes, links and pictures treated as you choose, with counts of what was removed.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"An HTML file, instead of the html parameter.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"html":{"type":"string","example":"<div onclick=\"x()\"><h1>Title</h1><script>alert(1)</script></div>","description":"The HTML (up to 5,000,000 characters), instead of a file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"mode":{"type":"string","enum":["sanitize","article","text","markdown"],"default":"sanitize","description":"sanitize (default: safe, tidy HTML), article (only the main content of a web page), text (plain text) or markdown.","x-davix-h2i-enum":"DocumentsCleanHtmlMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"allow_tags":{"type":"array","example":"[\"p\",\"a\",\"strong\"]","items":{"type":"string"},"description":"The tags to keep, as a list or comma-separated (default: headings, paragraphs, lists, links, images, tables, quotes, emphasis). Scripts, styles, frames and forms are never kept.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"remove_tags":{"type":"array","example":"[\"nav\",\"footer\"]","items":{"type":"string"},"description":"Tags to remove together with their content, in addition (for example nav,footer).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"unwrap_tags":{"type":"array","example":"[\"font\"]","items":{"type":"string"},"description":"Tags to take away while keeping what is inside them (for example font,span).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"allow_attributes":{"type":"array","example":"[\"itemprop\"]","items":{"type":"string"},"description":"Attributes to keep on every tag in addition to the safe ones (for example data-id, itemprop).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"strip_styles":{"type":"boolean","default":true,"description":"true (default): remove style attributes. false: keep a few safe ones (colour, alignment, weight).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"strip_classes":{"type":"boolean","default":true,"description":"true (default): remove class attributes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"strip_ids":{"type":"boolean","default":false,"description":"true: remove id attributes. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"strip_empty":{"type":"boolean","default":true,"description":"true (default): remove elements that have no text and no picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"links":{"type":"string","enum":["keep","nofollow","text","remove"],"default":"keep","description":"keep (default), nofollow (rel=\"nofollow noopener noreferrer ugc\"), text (remove the link, keep its text) or remove.","x-davix-h2i-enum":"DocumentsLinks","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"target_blank":{"type":"boolean","default":false,"description":"true: open links in a new tab (with rel=\"noopener noreferrer\"). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"images":{"type":"string","enum":["keep","alt","remove"],"default":"keep","description":"keep (default), alt (replace each picture with its alt text) or remove.","x-davix-h2i-enum":"DocumentsImages","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"base_address":{"type":"string","example":"https://example.com/blog/","description":"Make relative links and picture addresses absolute against this address.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"collapse_whitespace":{"type":"boolean","default":true,"description":"true (default): collapse runs of white space and put block tags on their own lines.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"minify":{"type":"boolean","default":false,"description":"true: remove all line breaks between tags. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"max_length":{"type":"integer","minimum":20,"maximum":1000000,"description":"Cut the result after this many characters, 20 to 1,000,000 (HTML is closed properly).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"text_links":{"type":"boolean","default":false,"description":"With mode=text: write the address after each link text, as \"text [address]\". Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"width":{"type":"integer","minimum":0,"maximum":500,"default":0,"description":"With mode=text: wrap lines at this many characters (0 = no wrapping).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"heading_style":{"type":"string","enum":["atx","setext"],"default":"atx","description":"With mode=markdown: atx (# Heading, default) or setext (underlined).","x-davix-h2i-enum":"DocumentsHeadingStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"bullet":{"type":"string","enum":["-","*","+"],"default":"-","description":"With mode=markdown: the bullet of lists: -, * or +.","x-davix-h2i-enum":"DocumentsBullet","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/clean-html.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"allow_tags":{"contentType":"application/json"},"remove_tags":{"contentType":"application/json"},"unwrap_tags":{"contentType":"application/json"},"allow_attributes":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, mode, result?, stats: { inputChars, outputChars, removed, removedAttributes, unwrapped, linksRemoved, imagesRemoved, emptyRemoved, title?, byline?, excerpt?, truncated? } }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["html","text","markdown"]},"mode":{"type":"string","enum":["sanitize","article","text","markdown"]},"result":{"type":"string","description":"The cleaned content (when it is at most 200,000 characters; the file always has it)."},"stats":{"type":"object","description":"inputChars, outputChars, removed (a count per removed tag), removedAttributes, unwrapped, linksRemoved, imagesRemoved, emptyRemoved, and for mode=article title, byline and excerpt; truncated when max_length cut it."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","mode","stats"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.clean-html","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/clean-html\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'html=<div onclick=\"x()\"><h1>Title</h1><script>alert(1)</script></div>' \\\n  -F 'mode=sanitize' \\\n  -F 'allow_tags=[\"p\",\"a\",\"strong\"]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.cleanHtml({\n    \"html\": \"<div onclick=\\\"x()\\\"><h1>Title</h1><script>alert(1)</script></div>\",\n    \"mode\": \"sanitize\",\n    \"allow_tags\": \"[\\\"p\\\",\\\"a\\\",\\\"strong\\\"]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->cleanHtml([\n    'html' => '<div onclick=\"x()\"><h1>Title</h1><script>alert(1)</script></div>',\n    'mode' => 'sanitize',\n    'allow_tags' => '[\"p\",\"a\",\"strong\"]',\n]);\necho $result->requestId;"}]}},"/v1/documents/clean-review":{"post":{"operationId":"documents.clean-review","summary":"Accept changes / remove comments","description":"Make a Word document ready to send: accept or reject all tracked changes, remove comments and hidden text, take personal names out of the properties and of the authors of what stays, and drop revision ids.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The document to clean: A Word (.docx) file.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"changes":{"type":"string","enum":["accept","reject","keep"],"default":"accept","description":"accept (default: insertions stay, deletions go), reject (insertions go, deletions come back) or keep (leave tracked changes as they are).","x-davix-h2i-enum":"DocumentsChanges","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-review.js"}},"remove_comments":{"type":"boolean","default":true,"description":"true (default): remove all comments and their markers.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-review.js"}},"remove_hidden_text":{"type":"boolean","default":false,"description":"true: remove text that is formatted as hidden. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-review.js"}},"remove_metadata":{"type":"boolean","default":false,"description":"true: empty the author, last-modified-by, company and manager fields and reset the revision count. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-review.js"}},"anonymize_authors":{"type":"boolean","default":false,"description":"true: replace the author of every change and comment that stays with \"Reviewer\". Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-review.js"}},"remove_rsids":{"type":"boolean","default":false,"description":"true: remove the revision ids Word writes into the file. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-review.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, changed, changes, insertions, deletions, moves, paragraphMarks, formatting, comments, hiddenRuns, authors, rsids, partsChanged, partsRemoved, sizeBefore, sizeAfter }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"changed":{"type":"boolean"},"changes":{"type":"string","enum":["accept","reject","keep"]},"insertions":{"type":"integer"},"deletions":{"type":"integer"},"moves":{"type":"integer"},"paragraphMarks":{"type":"integer"},"formatting":{"type":"integer","description":"Formatting changes (bold added ...) that were accepted or rolled back."},"comments":{"type":"integer"},"hiddenRuns":{"type":"integer"},"authors":{"type":"integer"},"rsids":{"type":"integer"},"partsChanged":{"type":"array","items":{"type":"string"}},"partsRemoved":{"type":"array","items":{"type":"string"}},"sizeBefore":{"type":"integer"},"sizeAfter":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","changed","changes","insertions","deletions","moves","paragraphMarks","formatting","comments","hiddenRuns","authors","rsids","partsChanged","partsRemoved","sizeBefore","sizeAfter"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.clean-review","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/clean-review\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'changes=accept' \\\n  -F 'remove_comments=true' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.cleanReview({\n    \"file\": 'document.pdf',\n    \"changes\": \"accept\",\n    \"remove_comments\": true,\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->cleanReview([\n    'file' => 'document.pdf',\n    'changes' => 'accept',\n    'remove_comments' => true,\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/documents/comic":{"post":{"operationId":"documents.comic","summary":"Comic / photo book","description":"Lay pictures out as a comic or a photo book: grid or comic-style panels, borders, rounded corners, captions, speech, thought and shout bubbles, a title page and page numbers, as a PDF or a ZIP of page pictures.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The pictures in the order they appear (PNG, JPEG, WebP ...). Up to 100.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"layout":{"type":"string","enum":["grid","comic","single"],"default":"grid","description":"grid (default: columns x rows), comic (a comic page pattern for panels_per_page panels) or single (one picture per page).","x-davix-h2i-enum":"DocumentsLayout","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"columns":{"type":"integer","minimum":1,"maximum":6,"default":2,"description":"grid: panels across, 1 to 6 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"rows":{"type":"integer","minimum":1,"maximum":6,"default":2,"description":"grid: panels down, 1 to 6 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"panels_per_page":{"type":"integer","minimum":1,"maximum":6,"default":4,"description":"comic: panels on a page, 1 to 6 (default 4); a wide panel on top, or in the middle for five.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"page_size":{"type":"string","enum":["a4","a5","letter","square"],"default":"a4","description":"a4 (default), a5, letter or square (210 x 210 mm).","x-davix-h2i-enum":"DocumentsPageSize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"orientation":{"type":"string","enum":["portrait","landscape"],"default":"portrait","description":"portrait (default) or landscape (not for square).","x-davix-h2i-enum":"Orientation2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"margin":{"type":"number","minimum":0,"maximum":40,"default":10,"description":"The page margin in millimetres, 0 to 40 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"gap":{"type":"number","minimum":0,"maximum":20,"default":4,"description":"The space between panels in millimetres, 0 to 20 (default 4).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"border_width":{"type":"number","minimum":0,"maximum":5,"default":0.5,"description":"The panel border in millimetres, 0 to 5 (default 0.5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"border_color":{"type":"string","format":"color","default":"#000000","example":"#1e293b","description":"The border colour as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"corner_radius":{"type":"number","minimum":0,"maximum":20,"default":0,"description":"Round the panel corners, in millimetres, 0 to 20 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"background":{"type":"string","format":"color","default":"#ffffff","example":"#fff8e1","description":"The page colour as a hex colour (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"fit":{"type":"string","enum":["cover","contain"],"default":"cover","description":"cover (default: the picture fills the panel and is cropped) or contain (the whole picture, with bars in the page colour).","x-davix-h2i-enum":"Fit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"captions":{"type":"array","example":"[\"The lake\",\"Dinner\"]","items":{"type":"string"},"description":"A caption for each picture, in order, as a list or one per line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"caption_position":{"type":"string","enum":["below","overlay"],"default":"below","description":"below (default: under the picture) or overlay (over its bottom edge).","x-davix-h2i-enum":"DocumentsCaptionPosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"caption_size":{"type":"number","minimum":6,"maximum":36,"default":10,"description":"The caption size in points, 6 to 36 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"caption_color":{"type":"string","format":"color","default":"#111827","description":"The caption text colour as a hex colour (default #111827). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"caption_background":{"type":"string","format":"color","example":"#ffff00","description":"The strip behind a caption as a hex colour or transparent (default: none below, dark over the picture). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"bubbles":{"type":"array","example":"[{\"panel\":1,\"text\":\"Hello!\",\"x\":50,\"y\":20}]","items":{"type":"object","properties":{"panel":{"type":"integer"},"text":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"shape":{"type":"string"},"tail":{"type":"string"}},"required":["panel","text"]},"description":"Speech bubbles: a list of { panel (the number of the picture, from 1), text, x and y (percent of the panel, the centre), width (percent), shape (speech, thought, shout, box), tail (down-left, down-right, up-left, up-right, none) }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"bubble_size":{"type":"number","minimum":6,"maximum":40,"default":11,"description":"The text size in bubbles in points, 6 to 40 (default 11).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"title":{"type":"string","example":"Our Summer","description":"Add a title page with this title (up to 120 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"subtitle":{"type":"string","example":"Photos from the lake","description":"The line under the title (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"page_numbers":{"type":"boolean","default":false,"description":"true: write \"1 / 5\" style page numbers at the bottom. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"dpi":{"type":"integer","minimum":100,"maximum":300,"default":150,"description":"The resolution the pages are drawn at, 100 to 300 (default 150).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"font":{"type":"string","enum":["sans","serif","mono"],"default":"sans","description":"sans (default), serif or mono, for captions, bubbles and the title.","x-davix-h2i-enum":"Font","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"output":{"type":"string","enum":["pdf","zip"],"default":"pdf","description":"pdf (default) or zip (a PNG of every page).","x-davix-h2i-enum":"Output","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/comic.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"captions":{"contentType":"application/json"},"bubbles":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, pages, panels, panelsPerPage, titlePage, layout, pageSize }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["pdf","zip"]},"pages":{"type":"integer","description":"How many pages the book has, including the title page."},"panels":{"type":"integer","description":"How many pictures were placed."},"panelsPerPage":{"type":"integer"},"titlePage":{"type":"boolean"},"layout":{"type":"string"},"pageSize":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","pages","panels","panelsPerPage","titlePage","layout","pageSize"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.comic","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/comic\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'layout=grid' \\\n  -F 'columns=2' \\\n  -F 'rows=2'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.comic({\n    \"files\": 'document.pdf',\n    \"layout\": \"grid\",\n    \"columns\": 2,\n    \"rows\": 2\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->comic([\n    'files' => 'document.pdf',\n    'layout' => 'grid',\n    'columns' => 2,\n    'rows' => 2,\n]);\necho $result->requestId;"}]}},"/v1/documents/compare":{"post":{"operationId":"documents.compare","summary":"Compare documents","description":"Compare the words of two documents of any type (Word, PDF, Excel, text ...): what was added and removed, a similarity score, the list of changes and a redline page.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The first (original) document.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"other":{"type":"string","format":"binary","description":"The second (revised) document.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"level":{"type":"string","enum":["word","paragraph"],"default":"word","description":"word (default: show the words that changed inside a rewritten paragraph) or paragraph (whole paragraphs only).","x-davix-h2i-enum":"DocumentsCompareLevel","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/compare.js"}},"ignore_case":{"type":"boolean","default":false,"description":"true: \"Apple\" and \"apple\" count as the same. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/compare.js"}},"ignore_whitespace":{"type":"boolean","default":true,"description":"true (default): runs of spaces and line breaks inside a paragraph do not count as changes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/compare.js"}},"report":{"type":"boolean","default":true,"description":"true (default): also write the redline page as an HTML file (`url`): insertions green, deletions red and struck through.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/compare.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"file_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the \"file\" input from this public http(s) address instead of uploading it. For each input send either the file or its URL, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"other_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the \"other\" input from this public http(s) address instead of uploading it. For each input send either the file or its URL, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","other"]}}}},"responses":{"200":{"description":"{ identical, similarity, addedWords, removedWords, unchangedWords, changeCount, changes[], truncated, fileA, fileB, wordsA, wordsB, url?, sizeBytes?, format? }","content":{"application/json":{"schema":{"type":"object","properties":{"identical":{"type":"boolean"},"similarity":{"type":"number","description":"Percent of words the two documents have in common (100 = the same words)."},"addedWords":{"type":"integer"},"removedWords":{"type":"integer"},"unchangedWords":{"type":"integer"},"changeCount":{"type":"integer"},"changes":{"type":"array","items":{"type":"object"},"description":"Up to 1000 changes, each { type: added | removed | changed, text } or { type: changed, before, after, removed?, added? }."},"truncated":{"type":"boolean"},"fileA":{"type":"string"},"fileB":{"type":"string"},"wordsA":{"type":"integer"},"wordsB":{"type":"integer"},"url":{"type":"string","format":"uri","description":"The redline page (report=true)."},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["identical","similarity","addedWords","removedWords","unchangedWords","changeCount","changes","truncated","wordsA","wordsB"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"fixed","field":"file","minFiles":2,"ceiling":2,"directFiles":1,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"documents.compare","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/compare\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'other=@document.pdf' \\\n  -F 'level=word' \\\n  -F 'ignore_case=false' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.compare({\n    \"file\": 'document.pdf',\n    \"other\": 'document.pdf',\n    \"level\": \"word\",\n    \"ignore_case\": false,\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->compare([\n    'file' => 'document.pdf',\n    'other' => 'document.pdf',\n    'level' => 'word',\n    'ignore_case' => false,\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/documents/compress":{"post":{"operationId":"documents.compress","summary":"Compress Office file","description":"Make a Word, Excel, PowerPoint or OpenDocument file smaller: its pictures are re-encoded (JPEG quality, an upper size, PNG recompressed or reduced to a palette), thumbnails and printer settings are dropped and every part is stored with the strongest ZIP compression.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The file to compress: A Word (.docx), Excel (.xlsx), PowerPoint (.pptx) or OpenDocument (.odt, .ods, .odp) file.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"image_quality":{"type":"integer","minimum":20,"maximum":95,"default":75,"description":"The JPEG quality of the pictures, 20 to 95 (default 75). Also the quality of a PNG palette.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-compress.js"}},"max_dimension":{"type":"integer","minimum":200,"maximum":10000,"default":2000,"description":"Scale a picture down when its longer side is more than this many pixels, 200 to 10000 (default 2000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-compress.js"}},"png_palette":{"type":"boolean","default":false,"description":"true: reduce PNG pictures to 256 colours (much smaller, slightly lossy). Default false: PNGs are only recompressed without loss.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-compress.js"}},"min_image_bytes":{"type":"integer","minimum":0,"maximum":50000000,"default":10000,"description":"Leave pictures smaller than this many bytes alone, 0 to 50000000 (default 10000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-compress.js"}},"remove_thumbnails":{"type":"boolean","default":true,"description":"true (default): drop the preview thumbnail of the file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-compress.js"}},"remove_printer_settings":{"type":"boolean","default":true,"description":"true (default): drop the stored printer settings.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-compress.js"}},"remove_metadata":{"type":"boolean","default":false,"description":"true: empty the author, company, title, keyword and similar fields in the properties. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-compress.js"}},"zip_level":{"type":"integer","minimum":1,"maximum":9,"default":9,"description":"The ZIP compression level, 1 to 9 (default 9).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-compress.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, sizeBefore, savedBytes, savedPercent, images: { found, replaced, resized, bytesBefore, bytesAfter }, removed, parts }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"sizeBefore":{"type":"integer"},"savedBytes":{"type":"integer"},"savedPercent":{"type":"number"},"images":{"type":"object","description":"found, replaced, resized, bytesBefore, bytesAfter: how many pictures were seen, re-encoded smaller, scaled down, and their size before and after."},"removed":{"type":"array","items":{"type":"string"},"description":"The parts that were dropped (thumbnail, printer settings, personal fields)."},"parts":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","sizeBefore","savedBytes","savedPercent","images","removed","parts"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.compress","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/compress\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'image_quality=75' \\\n  -F 'max_dimension=2000' \\\n  -F 'min_image_bytes=10000'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.compress({\n    \"file\": 'document.pdf',\n    \"image_quality\": 75,\n    \"max_dimension\": 2000,\n    \"min_image_bytes\": 10000\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->compress([\n    'file' => 'document.pdf',\n    'image_quality' => 75,\n    'max_dimension' => 2000,\n    'min_image_bytes' => 10000,\n]);\necho $result->requestId;"}]}},"/v1/documents/convert":{"post":{"operationId":"documents.convert","summary":"Convert between PDF and Office/ODF/RTF/EPUB/HTML/TXT/Markdown","description":"Convert between PDF and Office/ODF/RTF/EPUB/HTML/TXT/Markdown","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The source document. Its real type is detected from its CONTENT (not its extension).","x-davix-h2i-file":{"mimeTypes":["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/rtf","application/epub+zip","text/plain","text/markdown","text/html","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.ms-works","application/vnd.wordperfect","application/vnd.visio","application/vnd.ms-visio.drawing","image/vnd.djvu","application/vnd.ms-xpsdocument","application/vnd.oasis.opendocument.graphics","message/rfc822","application/vnd.ms-outlook","application/x-tex","text/x-rst","text/asciidoc","application/x-fictionbook+xml","text/x-mediawiki"],"extensions":["pdf","docx","xlsx","pptx","odt","ods","odp","rtf","epub","txt","text","md","markdown","html","htm","xhtml","doc","dot","xls","xlt","ppt","pot","pps","ppsx","wps","wpd","wp","vsd","vsdx","djvu","djv","xps","oxps","odg","eml","msg","tex","latex","rst","adoc","asciidoc","fb2","wiki","mediawiki"],"note":"Accepted source types (detected from content, not from the MIME header): pdf, docx, odt, rtf, doc, xlsx, ods, xls, pptx, ppsx, odp, ppt, pps, odg, wpd (WordPerfect), wps (Works word processor), vsd, vsdx (Visio), djvu (DjVu scan), xps (XPS), html, txt, md, epub; text sources (html, txt, md, tex, rst, mediawiki, fb2, adoc, eml, msg) are declared with `from`. Macro-enabled Office files, binary Office files that contain macros or link other files, and RTF with external links / DDE are rejected (400). Size limits are plan/settings limits. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"to":{"type":"string","enum":["jpeg","png","svg","pdf","pdfa","docx","xlsx","pptx","odt","ods","odp","rtf","epub","txt","md","html","doc","xls","ppt","pps","ppsx","csv"],"description":"Target format. Which targets are valid depends on the detected source type (see `actions`). png / jpeg render the first page, slide or sheet; csv writes the first sheet.","x-davix-h2i-enum":"DocumentsConvertTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"An unsupported source->target pair -> 400 invalid_parameter with details.allowed listing the valid targets.","evidence":"src/processing/pdfs/document-engine.js:convertDocument"}},"pdfaLevel":{"type":"string","enum":["1b","2b","3b"],"default":"2b","description":"PDF/A level (only for to=pdfa).","x-davix-h2i-enum":"DocumentsPdfaLevel","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/pdfs/pdfa-engine.js:convertToPdfa"},"x-davix-h2i-depends-on":[{"field":"to","equals":"pdfa"}]},"optimize":{"type":"boolean","description":"Shrink the PDF/A output (only for to=pdfa).","x-davix-h2i-behavior":{"onInvalid":"normalize","note":"true, or the string \"true\" (any case) = enabled; any other value = disabled.","evidence":"src/processing/pdfs/pdfa-engine.js:convertToPdfa"},"x-davix-h2i-depends-on":[{"field":"to","equals":"pdfa"}]},"password":{"type":"string","maxLength":256,"description":"Password of an encrypted Word, Excel or PowerPoint file (DOCX / XLSX / PPTX and the binary DOC / XLS / PPT). The password is used only to open the file, is never logged and is not stored; the result is not password protected.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Wrong password -> 400 (details.reason wrong_password); encrypted file without password -> 400 (password_required).","evidence":"src/processing/pdfs/document-engine.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","to"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{url, sourceFormat, targetFormat, mimeType, sizeBytes, warnings[]}. PDF import (pdf -> docx/pptx/...) is heuristic layout reconstruction; pdf -> xlsx/ods is heuristic table detection over the text layer; HTML sources are sanitised (scripts, styles, remote/local resources removed); macro-enabled Office files are refused.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sourceFormat":{"type":"string"},"targetFormat":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sourceFormat","targetFormat","mimeType","sizeBytes","warnings"],"additionalProperties":true}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-actions":{"selector":"to","style":"enum-field","items":[{"name":"pdfa","description":"Sources: pdf.","fields":["file","pdfaLevel","optimize","password"],"allowedValues":{"source":["pdf"]}},{"name":"docx","description":"Sources: pdf, odt, rtf, doc, html, txt, md, tex, rst, mediawiki, fb2, adoc, wpd, wps.","fields":["file","password"],"allowedValues":{"source":["pdf","odt","rtf","doc","html","txt","md","tex","rst","mediawiki","fb2","adoc","wpd","wps"]}},{"name":"odt","description":"Sources: pdf, docx, rtf, doc, html, txt, md, tex, rst, mediawiki, fb2, adoc, wpd, wps.","fields":["file","password"],"allowedValues":{"source":["pdf","docx","rtf","doc","html","txt","md","tex","rst","mediawiki","fb2","adoc","wpd","wps"]}},{"name":"rtf","description":"Sources: pdf, docx, odt, doc.","fields":["file","password"],"allowedValues":{"source":["pdf","docx","odt","doc"]}},{"name":"pptx","description":"Sources: pdf, odp, ppt, pps, ppsx.","fields":["file","password"],"allowedValues":{"source":["pdf","odp","ppt","pps","ppsx"]}},{"name":"odp","description":"Sources: pdf, pptx, ppt, pps, ppsx.","fields":["file","password"],"allowedValues":{"source":["pdf","pptx","ppt","pps","ppsx"]}},{"name":"xlsx","description":"Sources: pdf, ods, xls.","fields":["file","password"],"allowedValues":{"source":["pdf","ods","xls"]}},{"name":"ods","description":"Sources: pdf, xlsx, xls.","fields":["file","password"],"allowedValues":{"source":["pdf","xlsx","xls"]}},{"name":"epub","description":"Sources: pdf.","fields":["file","password"],"allowedValues":{"source":["pdf"]}},{"name":"pdf","description":"Sources: docx, odt, rtf, doc, xlsx, ods, xls, pptx, odp, ppt, pps, ppsx, odg, html, txt, md, epub, tex, rst, mediawiki, fb2, adoc, wpd, wps, vsd, vsdx, djvu, xps, eml, msg.","fields":["file","password"],"allowedValues":{"source":["docx","odt","rtf","doc","xlsx","ods","xls","pptx","odp","ppt","pps","ppsx","odg","html","txt","md","epub","tex","rst","mediawiki","fb2","adoc","wpd","wps","vsd","vsdx","djvu","xps","eml","msg"]}},{"name":"txt","description":"Sources: docx, odt, rtf, doc, html, tex, rst, mediawiki, fb2, adoc, wpd, wps, eml, msg.","fields":["file","password"],"allowedValues":{"source":["docx","odt","rtf","doc","html","tex","rst","mediawiki","fb2","adoc","wpd","wps","eml","msg"]}},{"name":"md","description":"Sources: docx, odt, rtf, doc, tex, rst, mediawiki, fb2, adoc, wpd, wps.","fields":["file","password"],"allowedValues":{"source":["docx","odt","rtf","doc","tex","rst","mediawiki","fb2","adoc","wpd","wps"]}},{"name":"doc","description":"Sources: docx, odt, rtf.","fields":["file","password"],"allowedValues":{"source":["docx","odt","rtf"]}},{"name":"html","description":"Sources: docx, odt, rtf, doc, xlsx, ods, xls, txt, md, tex, rst, mediawiki, fb2, adoc, wpd, wps, eml, msg.","fields":["file","password"],"allowedValues":{"source":["docx","odt","rtf","doc","xlsx","ods","xls","txt","md","tex","rst","mediawiki","fb2","adoc","wpd","wps","eml","msg"]}},{"name":"png","description":"Sources: docx, odt, rtf, doc, xlsx, ods, xls, pptx, odp, ppt, pps, ppsx, odg, vsd, vsdx.","fields":["file","password"],"allowedValues":{"source":["docx","odt","rtf","doc","xlsx","ods","xls","pptx","odp","ppt","pps","ppsx","odg","vsd","vsdx"]}},{"name":"jpeg","description":"Sources: docx, odt, rtf, doc, odg.","fields":["file","password"],"allowedValues":{"source":["docx","odt","rtf","doc","odg"]}},{"name":"xls","description":"Sources: xlsx, ods.","fields":["file","password"],"allowedValues":{"source":["xlsx","ods"]}},{"name":"csv","description":"Sources: xlsx, ods, xls.","fields":["file","password"],"allowedValues":{"source":["xlsx","ods","xls"]}},{"name":"ppt","description":"Sources: pptx, odp, pps, ppsx.","fields":["file","password"],"allowedValues":{"source":["pptx","odp","pps","ppsx"]}},{"name":"ppsx","description":"Sources: pptx, odp, ppt, pps.","fields":["file","password"],"allowedValues":{"source":["pptx","odp","ppt","pps"]}},{"name":"pps","description":"Sources: pptx, odp, ppt, ppsx.","fields":["file","password"],"allowedValues":{"source":["pptx","odp","ppt","ppsx"]}},{"name":"svg","description":"Sources: vsd, vsdx.","fields":["file","password"],"allowedValues":{"source":["vsd","vsdx"]}}]},"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.convert","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_email","allow_fmt_legacy_office","allow_fmt_markup_text","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/convert\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'to=jpeg' \\\n  -F 'pdfaLevel=2b' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.convert({\n    \"file\": 'document.pdf',\n    \"to\": \"jpeg\",\n    \"pdfaLevel\": \"2b\",\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->convert([\n    'file' => 'document.pdf',\n    'to' => 'jpeg',\n    'pdfaLevel' => '2b',\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/documents/ebook":{"post":{"operationId":"documents.ebook","summary":"Make an e-book","description":"Make an EPUB 3 e-book from Markdown, HTML or plain text (one file per chapter, or one file split at headings), with a cover, contents, metadata, a style and right-to-left support.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"The text of the book: Markdown, HTML or text files, in reading order (one per chapter, or one long file). Not needed when content is given.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"cover":{"type":"string","format":"binary","description":"The cover picture (JPEG, PNG or WebP). It is made into a JPEG of at most 1600 x 2400 pixels.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"content":{"type":"string","example":"# Chapter one\n\nOnce upon a time...","description":"The text of the book as Markdown (up to 20 MB), instead of or after the files.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"title":{"type":"string","example":"My Book","description":"The title (default: the first heading).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"author":{"type":"string","example":"Ada Lovelace","description":"The author.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"language":{"type":"string","default":"en","description":"The language code, for example en, de, ar or pt-BR (default en). Arabic, Persian, Hebrew and Urdu make the book read right to left.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"identifier":{"type":"string","example":"urn:isbn:9780306406157","description":"The unique id of the book, for example an ISBN (default: a new urn:uuid).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"publisher":{"type":"string","description":"The publisher.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"description":{"type":"string","description":"A short description (up to 4000 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"date":{"type":"string","example":"2026-11-16","description":"The publication date: 2026, 2026-11 or 2026-11-16 (default: today).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"rights":{"type":"string","description":"The rights statement, for example \"© 2026 Ada Lovelace\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"subjects":{"type":"array","example":"[\"history\",\"science\"]","items":{"type":"string"},"description":"Subjects or keywords, as a list or comma-separated (up to 20).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"series":{"type":"string","description":"The name of the series the book belongs to.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"series_index":{"type":"number","minimum":0,"maximum":9999,"description":"The place in the series, for example 2.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"format":{"type":"string","enum":["auto","markdown","html","text"],"default":"auto","description":"How to read the text: auto (default, from the file name and the content), markdown, html or text.","x-davix-h2i-enum":"DocumentsEbookFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"split_on":{"type":"string","enum":["h1","h2","h3","file","none"],"default":"h1","description":"Where a new chapter starts: h1 (default), h2, h3 (headings of that level), file (one chapter per file) or none (one chapter).","x-davix-h2i-enum":"DocumentsSplitOn","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"toc_depth":{"type":"integer","minimum":1,"maximum":6,"default":3,"description":"How many heading levels the contents show, 1 to 6 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"toc_page":{"type":"boolean","default":true,"description":"true (default): add a visible contents page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"title_page":{"type":"boolean","default":true,"description":"true (default): add a title page (title, author, publisher, rights).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"cover_title":{"type":"boolean","default":true,"description":"true (default): without a cover picture, make a simple cover page with the title and author.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"numbering":{"type":"boolean","default":false,"description":"true: number the chapters (\"1. \", \"2. \" ...). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"font":{"type":"string","enum":["serif","sans","mono"],"default":"serif","description":"serif (default), sans or mono: the body font stack.","x-davix-h2i-enum":"DocumentsFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"font_size":{"type":"number","minimum":70,"maximum":160,"default":100,"description":"The base text size in percent, 70 to 160 (default 100). Readers can still change it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"line_height":{"type":"number","minimum":1.1,"maximum":2.4,"default":1.5,"description":"The line height, 1.1 to 2.4 (default 1.5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"justify":{"type":"boolean","default":false,"description":"true: justified text with hyphenation. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"page_progression":{"type":"string","enum":["auto","ltr","rtl"],"default":"auto","description":"auto (default: from the language), ltr or rtl.","x-davix-h2i-enum":"DocumentsPageProgression","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"css":{"type":"string","example":"h1 { color: #7c2d12; }","description":"Your own CSS, added after the standard style (up to 30,000 characters). It must not load anything from outside.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"smart_quotes":{"type":"boolean","default":true,"description":"true (default): curly quotes, dashes and ellipses in Markdown text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"breaks":{"type":"boolean","default":false,"description":"true: a line break in the text becomes a line break in the book. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"drop_images":{"type":"boolean","default":false,"description":"true: leave out all pictures in the text. Default false (pictures given as data: addresses are packed into the book).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/ebook.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"subjects":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, title, chapters: [{ title, file, headings }], tocEntries, images, direction, identifier, hasCover, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["epub"]},"title":{"type":"string"},"chapters":{"type":"array","items":{"type":"object"},"description":"The chapters in order: title, file and the number of headings in it."},"tocEntries":{"type":"integer"},"images":{"type":"integer","description":"The pictures in the book, the cover included."},"direction":{"type":"string","enum":["ltr","rtl"]},"identifier":{"type":"string"},"hasCover":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","title","chapters","tocEntries","images","direction","identifier","hasCover"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":0,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"documents.ebook","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/ebook\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'content=# Chapter one\n\nOnce upon a time...' \\\n  -F 'title=My Book' \\\n  -F 'author=Ada Lovelace'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.ebook({\n    \"content\": \"# Chapter one\\n\\nOnce upon a time...\",\n    \"title\": \"My Book\",\n    \"author\": \"Ada Lovelace\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->ebook([\n    'content' => '# Chapter one\n\nOnce upon a time...',\n    'title' => 'My Book',\n    'author' => 'Ada Lovelace',\n]);\necho $result->requestId;"}]}},"/v1/documents/einvoice-create":{"post":{"operationId":"documents.einvoice-create","summary":"Create e-invoice","description":"Make a structured e-invoice (EN 16931) from invoice data: UBL 2.1 (Peppol BIS 3.0, XRechnung) or UN/CEFACT CII (Factur-X / ZUGFeRD profiles), as XML or as a readable PDF with the XML attached. Totals are exact to the cent, line by line and per VAT group, and the result is read back and checked.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"invoice":{"type":"object","example":"{\"number\":\"INV-1\",\"date\":\"2026-11-01\",\"currency\":\"EUR\",\"seller\":{\"name\":\"Acme GmbH\",\"street\":\"Hauptstr 1\",\"city\":\"Berlin\",\"postal_code\":\"10115\",\"country\":\"DE\",\"vat_id\":\"DE123456789\"},\"buyer\":{\"name\":\"Buyer SA\",\"street\":\"Rue 2\",\"city\":\"Paris\",\"postal_code\":\"75001\",\"country\":\"FR\"},\"items\":[{\"description\":\"Widget\",\"quantity\":3,\"unit_price\":19.99,\"tax_rate\":19}]}","description":"The invoice: { number, date, due_date, currency, type, seller: { name, trade_name, street, address_line2, city, postal_code, region, country, vat_id, tax_id, registration_id, registration_scheme, endpoint, endpoint_scheme, contact_name, contact_phone, contact_email }, buyer: { ... }, items: [{ description, detail, quantity, unit_code, unit_price, tax_rate, tax_category, exemption_reason, discount, item_id, buyer_item_id, note }], allowances: [{ amount, reason, tax_category, tax_rate }], charges: [...], payment: { means_code, iban, bic, account_name, bank_name, reference, terms }, buyer_reference, order_reference, contract_reference, project_reference, period: { start, end }, delivery_date, tax_point_date, tax_exemption_reason, amount_paid, rounding, notes }. Prices are net of tax; dates are YYYY-MM-DD.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"No invoice, no lines, a line without unit_price, a bad date, currency, VAT category or unit code -> 400.","evidence":"src/processing/documents/einvoice.js"}},"syntax":{"type":"string","enum":["ubl","cii"],"default":"ubl","description":"The XML language: ubl (UBL 2.1, default) or cii (UN/CEFACT Cross Industry Invoice, used by Factur-X and ZUGFeRD).","x-davix-h2i-enum":"DocumentsSyntax","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"profile":{"type":"string","enum":["en16931","peppol","xrechnung","facturx-minimum","facturx-basicwl","facturx-basic","facturx-en16931"],"description":"The profile: en16931 (European standard), peppol (Peppol BIS Billing 3.0), xrechnung (Germany), or Factur-X / ZUGFeRD facturx-minimum, facturx-basicwl, facturx-basic, facturx-en16931 (cii only). Default en16931 (ubl) or facturx-en16931 (cii).","x-davix-h2i-enum":"DocumentsProfile","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"type":{"type":"string","enum":["invoice","credit_note","corrected","prepayment","debit_note","self_billed"],"default":"invoice","description":"The kind of document: invoice (380, default), credit_note (381), corrected (384), prepayment (386), debit_note (383) or self_billed (389). Can also be given in the invoice.","x-davix-h2i-enum":"DocumentsEinvoiceCreateType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"output":{"type":"string","enum":["xml","pdf"],"default":"xml","description":"xml (default: the e-invoice file) or pdf (a readable invoice with the XML attached as factur-x.xml; cii only).","x-davix-h2i-enum":"DocumentsEinvoiceCreateOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"pretty":{"type":"boolean","default":true,"description":"true (default): indent the XML. false: one compact line per element.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"validate":{"type":"boolean","default":true,"description":"true (default): read the result back and check it against the business rules (peppol and xrechnung profiles add their own). The findings are in the answer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"template":{"type":"string","enum":["classic","modern","minimal","bold"],"default":"classic","description":"With output=pdf: the look of the readable invoice: classic (default), modern, minimal or bold.","x-davix-h2i-enum":"DocumentsEinvoiceCreateTemplate","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"direction":{"type":"string","enum":["ltr","rtl"],"default":"ltr","description":"With output=pdf: ltr (default) or rtl for Arabic, Hebrew, Persian and Urdu.","x-davix-h2i-enum":"Direction2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"paper":{"type":"string","enum":["a4","letter"],"default":"a4","description":"With output=pdf: a4 (default) or letter.","x-davix-h2i-enum":"Paper","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"locale":{"type":"string","default":"en-US","example":"de-DE","description":"With output=pdf: the language for dates and numbers, for example de-DE (default en-US).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"accent":{"type":"string","format":"color","example":"#2563eb","description":"With output=pdf: the accent colour as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["invoice"]},"encoding":{"invoice":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, syntax, profile, guideline, number, typeCode, currency, totals, taxBreakdown, lineCount, xml?, validation?, checkedAgainst? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["xml","pdf"]},"syntax":{"type":"string","enum":["ubl","cii"]},"profile":{"type":"string"},"guideline":{"type":"string","description":"The specification identifier written into the file (BT-24)."},"number":{"type":"string"},"typeCode":{"type":"string"},"currency":{"type":"string"},"totals":{"type":"object","description":"lines, allowances, charges, tax_exclusive, tax, tax_inclusive, prepaid, rounding, payable, as numbers."},"taxBreakdown":{"type":"array","items":{"type":"object"},"description":"One group per VAT category and rate: category, rate, taxable_amount, tax_amount, exemption_reason."},"lineCount":{"type":"integer"},"xml":{"type":"string","description":"The XML (when output is xml and it is at most 200,000 characters; the file always has it)."},"validation":{"type":"object","description":"valid, errorCount, warningCount and the first 50 issues (rule, severity, message, field). Absent when validate is false."},"checkedAgainst":{"type":"string","description":"What the check covered. It is not the official XSD and Schematron validation."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","syntax","profile","guideline","number","typeCode","currency","totals","taxBreakdown","lineCount"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"documents.einvoice-create","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/einvoice-create\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'invoice={\"number\":\"INV-1\",\"date\":\"2026-11-01\",\"currency\":\"EUR\",\"seller\":{\"name\":\"Acme GmbH\",\"street\":\"Hauptstr 1\",\"city\":\"Berlin\",\"postal_code\":\"10115\",\"country\":\"DE\",\"vat_id\":\"DE123456789\"},\"buyer\":{\"name\":\"Buyer SA\",\"street\":\"Rue 2\",\"city\":\"Paris\",\"postal_code\":\"75001\",\"country\":\"FR\"},\"items\":[{\"description\":\"Widget\",\"quantity\":3,\"unit_price\":19.99,\"tax_rate\":19}]}' \\\n  -F 'syntax=ubl' \\\n  -F 'profile=en16931'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.einvoiceCreate({\n    \"invoice\": \"{\\\"number\\\":\\\"INV-1\\\",\\\"date\\\":\\\"2026-11-01\\\",\\\"currency\\\":\\\"EUR\\\",\\\"seller\\\":{\\\"name\\\":\\\"Acme GmbH\\\",\\\"street\\\":\\\"Hauptstr 1\\\",\\\"city\\\":\\\"Berlin\\\",\\\"postal_code\\\":\\\"10115\\\",\\\"country\\\":\\\"DE\\\",\\\"vat_id\\\":\\\"DE123456789\\\"},\\\"buyer\\\":{\\\"name\\\":\\\"Buyer SA\\\",\\\"street\\\":\\\"Rue 2\\\",\\\"city\\\":\\\"Paris\\\",\\\"postal_code\\\":\\\"75001\\\",\\\"country\\\":\\\"FR\\\"},\\\"items\\\":[{\\\"description\\\":\\\"Widget\\\",\\\"quantity\\\":3,\\\"unit_price\\\":19.99,\\\"tax_rate\\\":19}]}\",\n    \"syntax\": \"ubl\",\n    \"profile\": \"en16931\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->einvoiceCreate([\n    'invoice' => '{\"number\":\"INV-1\",\"date\":\"2026-11-01\",\"currency\":\"EUR\",\"seller\":{\"name\":\"Acme GmbH\",\"street\":\"Hauptstr 1\",\"city\":\"Berlin\",\"postal_code\":\"10115\",\"country\":\"DE\",\"vat_id\":\"DE123456789\"},\"buyer\":{\"name\":\"Buyer SA\",\"street\":\"Rue 2\",\"city\":\"Paris\",\"postal_code\":\"75001\",\"country\":\"FR\"},\"items\":[{\"description\":\"Widget\",\"quantity\":3,\"unit_price\":19.99,\"tax_rate\":19}]}',\n    'syntax' => 'ubl',\n    'profile' => 'en16931',\n]);\necho $result->requestId;"}]}},"/v1/documents/einvoice-read":{"post":{"operationId":"documents.einvoice-read","summary":"Read e-invoice","description":"Read the data of an e-invoice (UBL, CII, Factur-X, ZUGFeRD, XRechnung, Peppol) from an XML file or from the XML attached to a PDF: parties, lines, VAT groups, totals and payment, as plain JSON, with amounts as numbers.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The e-invoice: an XML file, or a PDF with the XML attached.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"attachment":{"type":"string","example":"factur-x.xml","description":"When the PDF has several XML files attached: the name of the one to use (default: factur-x.xml, zugferd-invoice.xml or xrechnung.xml, else the first).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"lines":{"type":"boolean","default":true,"description":"true (default): list the invoice lines. false: only the header, the VAT groups and the totals.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"extract_xml":{"type":"boolean","default":false,"description":"true: also give the XML itself as a file (useful for a PDF). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ source, attachment?, attachments?, syntax, profile, guideline, type_code, type, number, issue_date, due_date, currency, buyer_reference, order_reference, notes, seller, buyer, payment, totals, tax_breakdown, line_count, lines?, xmlUrl?, xmlBytes? }","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["xml","pdf"]},"attachment":{"type":"string","description":"For a PDF: the name of the attached XML that was read."},"attachments":{"type":"array","items":{"type":"string"},"description":"For a PDF: the names of all attached files."},"syntax":{"type":"string","enum":["ubl","cii"]},"profile":{"type":"string"},"guideline":{"type":"string"},"type_code":{"type":"string"},"type":{"type":"string"},"number":{"type":"string"},"issue_date":{"type":"string"},"due_date":{"type":"string"},"currency":{"type":"string"},"buyer_reference":{"type":"string"},"order_reference":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}},"seller":{"type":"object","description":"name, street, city, postal_code, country, vat_id, registration_id, endpoint, contact_*."},"buyer":{"type":"object","description":"The same fields as the seller."},"payment":{"type":"object","description":"means_code, means, iban, bic, reference, terms."},"totals":{"type":"object","description":"lines, allowances, charges, tax_exclusive, tax, tax_inclusive, prepaid, rounding, payable."},"tax_breakdown":{"type":"array","items":{"type":"object"},"description":"category, rate, taxable_amount, tax_amount, exemption_reason."},"line_count":{"type":"integer"},"lines":{"type":"array","items":{"type":"object"},"description":"id, description, quantity, unit_code, unit_price, net_amount, tax_category, tax_rate."},"xmlUrl":{"type":"string","format":"uri","description":"With extract_xml: the XML as a file."},"xmlBytes":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["source","syntax","profile","currency"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.einvoice-read","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/einvoice-read\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'attachment=factur-x.xml' \\\n  -F 'lines=true' \\\n  -F 'extract_xml=false'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.einvoiceRead({\n    \"file\": 'document.pdf',\n    \"attachment\": \"factur-x.xml\",\n    \"lines\": true,\n    \"extract_xml\": false\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->einvoiceRead([\n    'file' => 'document.pdf',\n    'attachment' => 'factur-x.xml',\n    'lines' => true,\n    'extract_xml' => false,\n]);\necho $result->requestId;"}]}},"/v1/documents/einvoice-validate":{"post":{"operationId":"documents.einvoice-validate","summary":"Validate e-invoice","description":"Check an e-invoice (UBL, CII, Factur-X, ZUGFeRD, XRechnung; XML or PDF) against the business rules of EN 16931: mandatory fields, code lists, line and total arithmetic, VAT groups and exemption reasons, with the Peppol or XRechnung rules on request.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The e-invoice: an XML file, or a PDF with the XML attached.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"attachment":{"type":"string","example":"factur-x.xml","description":"When the PDF has several XML files attached: the name of the one to use (default: factur-x.xml, zugferd-invoice.xml or xrechnung.xml, else the first).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice.js"}},"rules":{"type":"string","enum":["en16931","peppol","xrechnung","basic"],"default":"en16931","description":"The rule set: en16931 (default), peppol (adds Peppol BIS 3.0 rules), xrechnung (adds the German BR-DE rules) or basic (only the arithmetic and the VAT groups).","x-davix-h2i-enum":"DocumentsRules","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice-validate.js"}},"strict":{"type":"boolean","default":false,"description":"true: warnings count as errors. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice-validate.js"}},"tolerance":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"The rounding difference allowed in the amounts, in currency units, 0 to 1 (default 0: exact to the cent).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice-validate.js"}},"check_iban":{"type":"boolean","default":true,"description":"true (default): check the IBAN check digits.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice-validate.js"}},"check_vat":{"type":"boolean","default":true,"description":"true (default): check the shape of the VAT numbers and that they fit the country.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/einvoice-validate.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ valid, rules, strict, errorCount, warningCount, errors, warnings, syntax, profile, number, currency, source, checkedAgainst }","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"rules":{"type":"string","enum":["en16931","peppol","xrechnung","basic"]},"strict":{"type":"boolean"},"errorCount":{"type":"integer"},"warningCount":{"type":"integer"},"errors":{"type":"array","items":{"type":"object"},"description":"Each finding: rule (for example BR-CO-15), severity, message, field."},"warnings":{"type":"array","items":{"type":"object"},"description":"Findings that do not make the invoice invalid (unless strict)."},"syntax":{"type":"string","enum":["ubl","cii"]},"profile":{"type":"string"},"number":{"type":"string"},"currency":{"type":"string"},"source":{"type":"string","enum":["xml","pdf"]},"checkedAgainst":{"type":"string","description":"What was checked. It is not the official XSD and Schematron validation."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["valid","rules","strict","errorCount","warningCount","errors","warnings","syntax","profile","source","checkedAgainst"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.einvoice-validate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/einvoice-validate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'attachment=factur-x.xml' \\\n  -F 'rules=en16931' \\\n  -F 'tolerance=0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.einvoiceValidate({\n    \"file\": 'document.pdf',\n    \"attachment\": \"factur-x.xml\",\n    \"rules\": \"en16931\",\n    \"tolerance\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->einvoiceValidate([\n    'file' => 'document.pdf',\n    'attachment' => 'factur-x.xml',\n    'rules' => 'en16931',\n    'tolerance' => 0,\n]);\necho $result->requestId;"}]}},"/v1/documents/email":{"post":{"operationId":"documents.email","summary":"E-mail to JSON","description":"Read an e-mail message (.eml or Outlook .msg) as data: who sent it and to whom, the subject, the dates, the ids that link a conversation, the text, the links and the list of attachments.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The e-mail message: an .eml (RFC 822 / MIME) or an Outlook .msg file.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"include_text":{"type":"boolean","default":true,"description":"true (default): include the message text. When the message has only an HTML body, the text is made from it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-json.js"}},"include_html":{"type":"boolean","default":false,"description":"true: also include the HTML body as written. It is NOT cleaned: never put it on a page as it is. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-json.js"}},"links":{"type":"boolean","default":true,"description":"true (default): list the web, mail and phone links found in the message.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-json.js"}},"headers":{"type":"boolean","default":false,"description":"true: include every header of an .eml (Received, X-..., DKIM ...). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-json.js"}},"max_text_chars":{"type":"integer","minimum":0,"maximum":5000000,"default":0,"description":"Cut the text after this many characters (0 = no cut, the default). The answer says truncated when it was cut.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-json.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ source, subject, from, to[], cc[], bcc[], replyTo[], date, messageId, inReplyTo, references[], text?, html?, links?, attachments[], attachmentCount, attachmentBytes, wordCount, truncated?, headers?, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","description":"eml or msg."},"subject":{"type":"string"},"from":{"type":"object","description":"The sender: { name, address }."},"to":{"type":"array","items":{"type":"object"},"description":"The recipients: [{ name, address }]."},"cc":{"type":"array","items":{"type":"object"}},"bcc":{"type":"array","items":{"type":"object"}},"replyTo":{"type":"array","items":{"type":"object"}},"date":{"type":"string"},"messageId":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"array","items":{"type":"string"}},"text":{"type":"string"},"html":{"type":"string"},"links":{"type":"array","items":{"type":"string"}},"attachments":{"type":"array","items":{"type":"object"},"description":"One per attachment: filename, contentType, size, inline, contentId. The content itself is never returned."},"attachmentCount":{"type":"integer"},"attachmentBytes":{"type":"integer"},"wordCount":{"type":"integer"},"truncated":{"type":"boolean"},"headers":{"type":"object","description":"Every header, when headers is true (.eml only)."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["source","subject","to","cc","bcc","replyTo","references","attachments","attachmentCount","attachmentBytes","wordCount"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.email","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/email\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'include_text=true' \\\n  -F 'include_html=false' \\\n  -F 'max_text_chars=0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.email({\n    \"file\": 'document.pdf',\n    \"include_text\": true,\n    \"include_html\": false,\n    \"max_text_chars\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->email([\n    'file' => 'document.pdf',\n    'include_text' => true,\n    'include_html' => false,\n    'max_text_chars' => 0,\n]);\necho $result->requestId;"}]}},"/v1/documents/email-html":{"post":{"operationId":"documents.email-html","summary":"E-mail HTML builder","description":"Build an e-mail from blocks (heading, text, button, image, divider, spacer, list, quote, columns, social, footer): table layout, inline styles, an Outlook-safe button, a preheader, dark mode, right-to-left support, a plain-text version and delivery checks.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"blocks":{"type":"array","example":"[{\"type\":\"heading\",\"text\":\"Welcome\"},{\"type\":\"button\",\"text\":\"Open\",\"url\":\"https://example.com\"}]","items":{"type":"object","properties":{"type":{"type":"string","enum":["heading","text","button","image","divider","spacer","list","quote","columns","social","footer","html"],"description":"The kind of block.","x-davix-h2i-enum":"DocumentsEmailHtmlType"},"text":{"type":"string","description":"The text (heading, text, button, quote, footer). Accepts **bold**, *italic* and [text](address)."},"level":{"type":"integer","minimum":1,"maximum":3,"description":"Heading level 1 to 3."},"url":{"type":"string","description":"The address of a button or an image."},"alt":{"type":"string","description":"The alt text of an image."},"link_url":{"type":"string","description":"Where a click on an image goes."},"align":{"type":"string","enum":["left","center","right"],"description":"left, center or right.","x-davix-h2i-enum":"Align"},"color":{"type":"string","format":"color","description":"The colour of the block (text, button, divider or quote bar) as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"text_color":{"type":"string","format":"color","description":"The text colour of a button or a quote. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"width":{"type":"number","description":"The width in pixels of an image or a button."},"height":{"type":"number","description":"The height in pixels of a spacer."},"thickness":{"type":"number","description":"The thickness in pixels of a divider."},"spacing":{"type":"number","description":"The space above and below a divider."},"ordered":{"type":"boolean","description":"A numbered list."},"items":{"type":"array","items":{"type":"string"},"description":"The items of a list."},"author":{"type":"string","description":"Who said a quote."},"columns":{"type":"array","items":{"type":"array","items":{}},"description":"For columns: two or three lists of blocks."},"links":{"type":"array","items":{"type":"object"},"description":"For social: a list of { name, url }."},"html":{"type":"string","description":"For an html block: your own markup (no scripts or event handlers)."},"decorative":{"type":"boolean","description":"An image that needs no alt text."}},"required":["type"]},"description":"The content, a list of blocks. heading { text, level 1-3 }, text { text }, button { text, url, color, text_color, width }, image { url, alt, width, link_url }, divider, spacer { height }, list { items, ordered }, quote { text, author }, columns { columns: [[blocks],[blocks]] }, social { links: [{ name, url }] }, footer { text }, html { html }. Every block can have align (left, center, right) and color. Text accepts **bold**, *italic* and [text](address).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"title":{"type":"string","example":"Welcome to Acme","description":"The title of the message (the <title> of the HTML).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"preheader":{"type":"string","example":"Your account is ready.","description":"The hidden preview text that mail apps show next to the subject (up to 200 characters, 40 to 100 is best).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"width":{"type":"integer","minimum":320,"maximum":800,"default":600,"description":"The width of the message in pixels, 320 to 800 (default 600).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"background":{"type":"string","format":"color","default":"#f3f4f6","description":"The colour behind the message as a hex colour (default #f3f4f6). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"content_background":{"type":"string","format":"color","default":"#ffffff","description":"The colour of the message card (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"text_color":{"type":"string","format":"color","default":"#1f2937","description":"The text colour (default #1f2937). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"link_color":{"type":"string","format":"color","default":"#2563eb","description":"The link colour (default #2563eb). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"accent":{"type":"string","format":"color","default":"#2563eb","description":"The colour of buttons and quote bars (default #2563eb). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"font":{"type":"string","enum":["sans","serif","system","mono"],"default":"sans","description":"sans (default), serif, system or mono: the font stack.","x-davix-h2i-enum":"DocumentsEmailHtmlFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"font_size":{"type":"integer","minimum":12,"maximum":22,"default":16,"description":"The text size in pixels, 12 to 22 (default 16).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"line_height":{"type":"number","minimum":1.1,"maximum":2.2,"default":1.55,"description":"The line height, 1.1 to 2.2 (default 1.55).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"padding":{"type":"integer","minimum":8,"maximum":64,"default":32,"description":"The space inside the card in pixels, 8 to 64 (default 32).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"radius":{"type":"integer","minimum":0,"maximum":32,"default":8,"description":"The corner radius of the card, pictures and buttons, 0 to 32 (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"border":{"type":"boolean","default":false,"description":"true: a thin border around the card. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"language":{"type":"string","default":"en","description":"The language code of the message (default en).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"dir":{"type":"string","enum":["auto","ltr","rtl"],"default":"auto","description":"auto (default: from the language), ltr or rtl.","x-davix-h2i-enum":"DocumentsDir","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"dark_mode":{"type":"boolean","default":true,"description":"true (default): colours that follow the dark mode of the mail app.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"outlook":{"type":"boolean","default":true,"description":"true (default): add the code that makes buttons and columns look right in Outlook for Windows.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"logo_url":{"type":"string","example":"https://example.com/logo.png","description":"A picture address for a logo at the top.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"logo_width":{"type":"integer","minimum":20,"maximum":400,"default":140,"description":"The logo width in pixels, 20 to 400 (default 140).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"logo_alt":{"type":"string","description":"The alt text of the logo.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"unsubscribe_url":{"type":"string","example":"https://example.com/unsubscribe","description":"The unsubscribe address, shown in the footer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"unsubscribe_text":{"type":"string","default":"Unsubscribe","description":"The text of the unsubscribe link (default Unsubscribe).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"address":{"type":"string","example":"Acme Ltd, 1 High Street, London","description":"The postal address of the sender, shown in the footer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"view_in_browser_url":{"type":"string","description":"The address of the web version; adds a \"View in browser\" line on top.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"view_in_browser_text":{"type":"string","default":"View in browser","description":"The text of that link (default View in browser).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/email-html.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["blocks"]},"encoding":{"blocks":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, html?, text, blocks, links, images, imagesWithoutAlt, direction, gmailClipped, warnings }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["html"]},"html":{"type":"string","description":"The HTML (when it is at most 150,000 characters; the file always has it)."},"text":{"type":"string","description":"The plain-text version, to send as the text/plain part."},"blocks":{"type":"integer"},"links":{"type":"integer"},"images":{"type":"integer"},"imagesWithoutAlt":{"type":"integer"},"direction":{"type":"string","enum":["ltr","rtl"]},"gmailClipped":{"type":"boolean","description":"true when the HTML is above 102 KB and Gmail will cut the message."},"warnings":{"type":"array","items":{"type":"string"},"description":"Delivery checks: size, missing alt text, missing preheader or unsubscribe link, mostly pictures."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","text","blocks","links","images","imagesWithoutAlt","direction","gmailClipped","warnings"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"documents.email-html","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/email-html\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'blocks=[{\"type\":\"heading\",\"text\":\"Welcome\"},{\"type\":\"button\",\"text\":\"Open\",\"url\":\"https://example.com\"}]' \\\n  -F 'title=Welcome to Acme' \\\n  -F 'preheader=Your account is ready.'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.emailHtml({\n    \"blocks\": \"[{\\\"type\\\":\\\"heading\\\",\\\"text\\\":\\\"Welcome\\\"},{\\\"type\\\":\\\"button\\\",\\\"text\\\":\\\"Open\\\",\\\"url\\\":\\\"https://example.com\\\"}]\",\n    \"title\": \"Welcome to Acme\",\n    \"preheader\": \"Your account is ready.\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->emailHtml([\n    'blocks' => '[{\"type\":\"heading\",\"text\":\"Welcome\"},{\"type\":\"button\",\"text\":\"Open\",\"url\":\"https://example.com\"}]',\n    'title' => 'Welcome to Acme',\n    'preheader' => 'Your account is ready.',\n]);\necho $result->requestId;"}]}},"/v1/documents/encode":{"post":{"operationId":"documents.encode","summary":"Encode / decode","description":"Encode or decode a text or a file: Base64, Base64URL, hex, URL, HTML entities, Punycode, quoted-printable, binary, Ascii85, ROT13, \\u escapes and Morse; or read the header and payload of a JWT.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"A file whose bytes are encoded, or whose text is decoded. Send this or the text field.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"text":{"type":"string","example":"Hello, world","description":"The text to encode or decode (instead of a file; up to 20 MB).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-encode.js"}},"scheme":{"type":"string","enum":["base64","base64url","hex","url","html","punycode","quoted-printable","binary","ascii85","rot13","unicode","morse","jwt"],"default":"base64","description":"The encoding: base64, base64url, hex, url, html, punycode, quoted-printable, binary, ascii85, rot13, unicode, morse, jwt (default base64). jwt can only be decoded; it is read, not verified.","x-davix-h2i-enum":"DocumentsScheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"action":{"type":"string","enum":["encode","decode"],"default":"encode","description":"encode (default) or decode.","x-davix-h2i-enum":"DocumentsEncodeAction","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"charset":{"type":"string","enum":["utf-8","utf-16le","utf-16be","latin1","ascii","windows-1252","windows-1251","iso-8859-2","iso-8859-15","shift_jis","gbk","big5","euc-kr"],"default":"utf-8","description":"The character set that turns a text into bytes and bytes back into text (default utf-8).","x-davix-h2i-enum":"DocumentsCharset","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"url_mode":{"type":"string","enum":["component","uri","form"],"default":"component","description":"URL scheme: component (default, encodes / ? & =), uri (keeps them) or form (spaces as +).","x-davix-h2i-enum":"DocumentsUrlMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"line_length":{"type":"integer","minimum":0,"maximum":1000,"default":0,"description":"Break the result into lines of this length (Base64, Base64URL, hex, Ascii85, quoted-printable), 0 to 1000 (0 = one line).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"separator":{"type":"string","default":" ","description":"hex and binary: what goes between the bytes (default one space; use none for nothing). At most 5 characters.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"uppercase":{"type":"boolean","default":false,"description":"hex and unicode: capital letters. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"padding":{"type":"boolean","default":true,"description":"Base64 and Base64URL: keep the = padding. Default true for Base64 and Base64URL.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"all_characters":{"type":"boolean","default":false,"description":"html and unicode: also write plain ASCII characters as entities / escapes. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encode.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ action, scheme, charset, inputBytes, outputBytes?, outputChars?, binary?, text?, hexPreview?, jwt?: { header, payload, algorithm, expired?, times, signaturePresent, verified }, url, sizeBytes, format }","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["encode","decode"]},"scheme":{"type":"string"},"charset":{"type":"string"},"inputBytes":{"type":"integer"},"outputBytes":{"type":"integer","description":"decode: the size of the result in bytes."},"outputChars":{"type":"integer","description":"encode: the length of the result in characters."},"binary":{"type":"boolean","description":"decode: true when the result is not text in the chosen character set (then hexPreview shows its start)."},"text":{"type":"string","description":"The result as text, when it is at most 100 KB."},"hexPreview":{"type":"string","description":"decode of binary data: the first 32 bytes as hex."},"jwt":{"type":"object","description":"jwt: header, payload, algorithm, expired, times (exp, nbf, iat), signaturePresent and verified (always false: the signature is not checked)."},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["action","scheme","charset","inputBytes","url","sizeBytes","format"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.encode","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/encode\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text=Hello, world' \\\n  -F 'scheme=base64' \\\n  -F 'action=encode'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.encode({\n    \"text\": \"Hello, world\",\n    \"scheme\": \"base64\",\n    \"action\": \"encode\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->encode([\n    'text' => 'Hello, world',\n    'scheme' => 'base64',\n    'action' => 'encode',\n]);\necho $result->requestId;"}]}},"/v1/documents/encoding":{"post":{"operationId":"documents.encoding","summary":"Fix text encoding","description":"Detect the encoding of a text file, repair garbled text (UTF-8 read as Windows-1252, \"Ã©\" for \"é\") and write it in the encoding you choose, with line endings, a byte order mark, normalisation and control characters under your control.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The text file (any text format: txt, csv, srt, html, xml, json ...), up to 20 MB.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"from":{"type":"string","default":"auto","example":"windows-1256","description":"The encoding of the file: auto (default, from a byte order mark, UTF-8 validity and the most plausible legacy encoding) or a name such as windows-1252, iso-8859-9, windows-1256, shift_jis, gbk, euc-kr, koi8-r, utf-16le.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"to":{"type":"string","default":"utf-8","description":"The encoding to write: utf-8 (default) or any other name, for example utf-16le, windows-1252, iso-8859-1, shift_jis.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"bom":{"type":"boolean","default":false,"description":"true: write a byte order mark (UTF-8, UTF-16, UTF-32). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"strip_bom":{"type":"boolean","default":true,"description":"true (default): remove a byte order mark that the file starts with before converting.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"newline":{"type":"string","enum":["keep","lf","crlf","cr"],"default":"keep","description":"keep (default), lf (Unix), crlf (Windows) or cr (old Mac): the line endings of the result.","x-davix-h2i-enum":"DocumentsNewline","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"normalize":{"type":"string","enum":["none","NFC","NFD","NFKC","NFKD"],"default":"none","description":"Unicode normalisation: none (default), NFC, NFD, NFKC or NFKD. NFC makes accents one character; NFKC also folds look-alikes.","x-davix-h2i-enum":"DocumentsNormalize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"fix_mojibake":{"type":"boolean","default":true,"description":"true (default): repair text that was decoded with the wrong encoding before (up to two layers).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"strip_control":{"type":"boolean","default":false,"description":"true: remove control characters and zero-width characters (not tabs and line breaks). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"on_invalid":{"type":"string","enum":["replace","skip","error"],"default":"replace","description":"What to do with bytes that are not valid in the source encoding: replace (default, with �), skip or error (400).","x-davix-h2i-enum":"DocumentsOnInvalid","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"extension":{"type":"string","example":"txt","description":"The extension of the result file (default: that of the upload).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/encoding.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, encoding, detected, confidence, detectedBy, usedEncoding, candidates, hadBom, invalidBytes, mojibakeLayersFixed, controlCharsRemoved, unmappableCharacters, lineEndingsBefore, lineEndingsAfter, charactersIn, charactersOut, bomWritten }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"encoding":{"type":"string","description":"The encoding of the result file."},"detected":{"type":"string","description":"The encoding found in the upload."},"confidence":{"type":"string","enum":["high","medium","low","given"]},"detectedBy":{"type":"string"},"usedEncoding":{"type":"string"},"candidates":{"type":"array","items":{"type":"object"},"description":"The most plausible encodings with a score from 0 to 1."},"hadBom":{"type":"boolean"},"invalidBytes":{"type":"integer"},"mojibakeLayersFixed":{"type":"integer"},"controlCharsRemoved":{"type":"integer"},"unmappableCharacters":{"type":"integer","description":"Characters the target encoding cannot hold (written as ?)."},"lineEndingsBefore":{"type":"object","description":"Counts of crlf, lf and cr line endings before the conversion."},"lineEndingsAfter":{"type":"object"},"charactersIn":{"type":"integer"},"charactersOut":{"type":"integer"},"bomWritten":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","encoding","detected","confidence","detectedBy","usedEncoding","candidates","hadBom","invalidBytes","mojibakeLayersFixed","controlCharsRemoved","unmappableCharacters","lineEndingsBefore","lineEndingsAfter","charactersIn","charactersOut","bomWritten"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.encoding","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/encoding\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'from=windows-1256' \\\n  -F 'newline=keep' \\\n  -F 'normalize=none'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.encoding({\n    \"file\": 'document.pdf',\n    \"from\": \"windows-1256\",\n    \"newline\": \"keep\",\n    \"normalize\": \"none\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->encoding([\n    'file' => 'document.pdf',\n    'from' => 'windows-1256',\n    'newline' => 'keep',\n    'normalize' => 'none',\n]);\necho $result->requestId;"}]}},"/v1/documents/feed":{"post":{"operationId":"documents.feed","summary":"Read a feed or sitemap","description":"Read an RSS, Atom or JSON feed or a sitemap (a web address or the text itself) into one list of entries, filtered by date and word, sorted, cut to a limit, as data or a CSV file. The address is fetched with the same guard as every other URL input.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"url":{"type":"string","example":"https://example.com/feed.xml","description":"The web address of the feed or sitemap (public http or https). Send this or xml.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-feed.js"}},"xml":{"type":"string","description":"The text of the feed or sitemap (instead of url; up to 10 million characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-feed.js"}},"kind":{"type":"string","enum":["auto","rss","atom","json","sitemap"],"default":"auto","description":"auto (default: found from the text), rss, atom, json or sitemap.","x-davix-h2i-enum":"DocumentsFeedKind","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"base_url":{"type":"string","description":"The address that relative links are made absolute against (default: the address of the feed).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"since":{"type":"string","description":"Only entries published or updated on or after this date, for example 2024-03-01.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"before":{"type":"string","description":"Only entries published or updated before this date.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"contains":{"type":"string","description":"Only entries whose title, summary, link or categories contain this word (not case-sensitive).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"sort":{"type":"string","enum":["source","newest","oldest"],"default":"source","description":"source (default), newest or oldest.","x-davix-h2i-enum":"DocumentsFeedSort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"limit":{"type":"integer","minimum":1,"maximum":50000,"default":100,"description":"Return at most this many entries, 1 to 50000 (default 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"unique":{"type":"boolean","default":true,"description":"true (default): leave out repeated entries (same id or link).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"summary_length":{"type":"integer","minimum":0,"maximum":20000,"default":500,"description":"The longest summary in characters, 0 to 20000 (0 = none; default 500).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"strip_html":{"type":"boolean","default":true,"description":"true (default): turn the HTML of summaries and content into plain text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"include_content":{"type":"boolean","default":false,"description":"true: also return the full content of each entry. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"output":{"type":"string","enum":["json","csv"],"default":"json","description":"json (default: in the answer) or csv: also write a CSV file.","x-davix-h2i-enum":"DocumentsFeedOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/feed.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}}}}},"responses":{"200":{"description":"{ requestedUrl?, finalUrl?, status?, kind, feed: { title, link, description, language, updated }, count, total, truncated, entries: [{ title, link, id, published, updated, author, summary, content?, categories, attachment }], warnings?, url?, sizeBytes?, format? }","content":{"application/json":{"schema":{"type":"object","properties":{"requestedUrl":{"type":"string"},"finalUrl":{"type":"string"},"status":{"type":"integer"},"kind":{"type":"string","enum":["rss","atom","json","sitemap","sitemap-index"]},"feed":{"type":"object","description":"title, link, description, language and updated of the feed."},"count":{"type":"integer"},"total":{"type":"integer","description":"How many entries were left after the filters, before limit."},"truncated":{"type":"boolean"},"entries":{"type":"array","items":{"type":"object"},"description":"title, link, id, published, updated, author, summary, content, categories and attachment; sitemaps also changefreq and priority."},"warnings":{"type":"array","items":{"type":"string"}},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["kind","feed","count","total","truncated","entries"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"documents.feed","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/feed\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'url=https://example.com/feed.xml' \\\n  -F 'kind=auto' \\\n  -F 'sort=source'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.feed({\n    \"url\": \"https://example.com/feed.xml\",\n    \"kind\": \"auto\",\n    \"sort\": \"source\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->feed([\n    'url' => 'https://example.com/feed.xml',\n    'kind' => 'auto',\n    'sort' => 'source',\n]);\necho $result->requestId;"}]}},"/v1/documents/file-type":{"post":{"operationId":"documents.file-type","summary":"Detect file type","description":"Find out what a file really is from its content (pictures, documents, archives, audio, video, fonts, databases, programs, text): its type, mime type and kind, whether its name lies, programs hidden under a harmless name, macros in Office files and programs inside archives.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The files to look at.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"expect":{"type":"array","example":"[\"png\",\"jpg\",\"pdf\"]","items":{"type":"string"},"description":"The types you accept: extensions (png), mime types (image/png), mime groups (image/*) or kinds (image, document, archive, audio, video, font, program, text). Every result then says allowed.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/file-type.js"}},"deep":{"type":"boolean","default":true,"description":"true (default): look inside ZIP and older Office files to tell Word, Excel, PowerPoint, OpenDocument, e-books, apps and macros apart. false: look only at the first bytes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/file-type.js"}},"max_entries":{"type":"integer","minimum":0,"maximum":500,"default":25,"description":"For archives: how many file names to list, 0 to 500 (default 25).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/file-type.js"}},"hash":{"type":"boolean","default":false,"description":"true: add the SHA-256 of every file. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/file-type.js"}},"signature":{"type":"boolean","default":false,"description":"true: add the first 16 bytes of every file as hex. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/file-type.js"}},"text_sample":{"type":"boolean","default":false,"description":"true: for text files, add the first 400 characters. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/file-type.js"}},"strict":{"type":"boolean","default":false,"description":"true: treat a file whose name or declared type lies as not allowed. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/file-type.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"expect":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ count, flagged, allAllowed?, results: [{ originalName, sizeBytes, extension, mime, kind, description, confidence, declaredExtension, declaredMime, matchesName, isArchive, isExecutable, hasMacros, isText, archive?, delimiter?, warnings, allowed?, sha256?, signature?, textSample? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"flagged":{"type":"integer","description":"How many files have a warning."},"allAllowed":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string"},"sizeBytes":{"type":"integer"},"extension":{"type":"string","description":"The extension the content calls for, without the dot."},"mime":{"type":"string"},"kind":{"type":"string","enum":["image","document","archive","audio","video","font","program","database","data","text","unknown"]},"description":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"declaredExtension":{"type":"string","nullable":true},"declaredMime":{"type":"string","nullable":true},"matchesName":{"type":"boolean","nullable":true,"description":"false when the name says another type; null when the name has no extension."},"isArchive":{"type":"boolean"},"isExecutable":{"type":"boolean"},"hasMacros":{"type":"boolean"},"isText":{"type":"boolean"},"archive":{"type":"object","description":"For a ZIP: entries, listing and programs found inside."},"delimiter":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"allowed":{"type":"boolean"},"sha256":{"type":"string"},"signature":{"type":"string"},"textSample":{"type":"string"}},"required":["sizeBytes","extension","mime","kind","description","confidence","isArchive","isExecutable","hasMacros","isText","warnings"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["count","flagged","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"documents.file-type","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/file-type\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'expect=[\"png\",\"jpg\",\"pdf\"]' \\\n  -F 'deep=true' \\\n  -F 'max_entries=25'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.fileType({\n    \"files\": 'document.pdf',\n    \"expect\": \"[\\\"png\\\",\\\"jpg\\\",\\\"pdf\\\"]\",\n    \"deep\": true,\n    \"max_entries\": 25\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->fileType([\n    'files' => 'document.pdf',\n    'expect' => '[\"png\",\"jpg\",\"pdf\"]',\n    'deep' => true,\n    'max_entries' => 25,\n]);\necho $result->requestId;"}]}},"/v1/documents/font":{"post":{"operationId":"documents.font","summary":"Font convert","description":"Convert a font between TTF, OTF, WOFF and WOFF2, or describe it: names, license, metrics, weight, and the characters it covers. The glyphs are never changed, only the wrapper.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The font: TTF, OTF, TTC (a collection), WOFF or WOFF2, up to 40 MB.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"to":{"type":"string","enum":["woff2","woff","sfnt","info"],"default":"woff2","description":"woff2 (default, the smallest for web pages), woff, sfnt (back to TTF or OTF) or info (only describe the font, no file).","x-davix-h2i-enum":"DocumentsFontTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/font.js"}},"info":{"type":"boolean","default":false,"description":"true: also describe the font in `info`, next to the converted file. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/font.js"}},"compression_level":{"type":"integer","minimum":0,"maximum":11,"description":"WOFF: zlib level 1 to 9 (default 9). WOFF2: Brotli quality 0 to 11 (default 11).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/font.js"}},"index":{"type":"integer","minimum":0,"maximum":255,"default":0,"description":"For a TTC collection: which font to take, 0 to 255 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/font.js"}},"metadata":{"type":"string","example":"<metadata version=\"1.0\"><vendor name=\"Example\" url=\"https://example.com\"/></metadata>","description":"WOFF extended metadata: an XML document that starts with <metadata> (vendor, license, credits). Stored in the WOFF or WOFF2 file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/font.js"}},"drop_tables":{"type":"string","example":"DSIG","description":"Tables to leave out, comma-separated (for example DSIG,kern,GPOS), to make the file smaller.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/font.js"}},"strip_names":{"type":"boolean","default":false,"description":"true: keep only the family, style, full name and PostScript name in the name table (drops copyright and license text). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/font.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url?, sizeBytes?, format, extension?, from, to, tables, droppedTables?, inputBytes, outputBytes?, ratio?, info? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["woff","woff2","ttf","otf","info"]},"extension":{"type":"string"},"from":{"type":"string","enum":["sfnt","woff","woff2"]},"to":{"type":"string","enum":["woff","woff2","sfnt","info"]},"tables":{"type":"integer"},"droppedTables":{"type":"array","items":{"type":"string"}},"inputBytes":{"type":"integer"},"outputBytes":{"type":"integer"},"ratio":{"type":"number","description":"The size of the result compared with the upload."},"info":{"type":"object","description":"The font facts: format, outlines, names (family, subfamily, fullName, version, copyright, license ...), glyphs, unitsPerEm, weight, italic, bold, metrics, embedding, characters, blocks, tables, variable, colour."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["format","from","to","tables","inputBytes"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.font","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/font\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'to=woff2' \\\n  -F 'compression_level=0' \\\n  -F 'index=0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.font({\n    \"file\": 'document.pdf',\n    \"to\": \"woff2\",\n    \"compression_level\": 0,\n    \"index\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->font([\n    'file' => 'document.pdf',\n    'to' => 'woff2',\n    'compression_level' => 0,\n    'index' => 0,\n]);\necho $result->requestId;"}]}},"/v1/documents/format-code":{"post":{"operationId":"documents.format-code","summary":"Format and minify code","description":"Make JSON, CSS, HTML, XML, SQL or JavaScript tidy (beautify, with your indent) or small (minify). Only white space and comments change; JSON can also sort its keys; inline script and style in HTML can be formatted too.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"The code as a file (.json, .css, .html, .xml, .sql, .js ...). Send this or the text field.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"text":{"type":"string","example":"{\"b\":1,\"a\":[1,2]}","description":"The code as text (instead of a file; up to 5 MB).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-format-code.js"}},"action":{"type":"string","enum":["beautify","minify"],"default":"beautify","description":"beautify (default) or minify.","x-davix-h2i-enum":"DocumentsFormatCodeAction","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"language":{"type":"string","enum":["json","css","html","xml","sql","javascript"],"description":"json, css, html, xml, sql or javascript. Default: taken from the file name, or guessed from the text.","x-davix-h2i-enum":"DocumentsFormatCodeLanguage","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"indent":{"type":"integer","minimum":0,"maximum":8,"default":2,"description":"Spaces per level when beautifying, 0 to 8 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"use_tabs":{"type":"boolean","default":false,"description":"true: indent with tabs. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"keep_comments":{"type":"boolean","default":true,"description":"true (default): keep comments when beautifying; when minifying only /*! ... */ comments (licences) and HTML conditional comments are kept.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"sort_keys":{"type":"boolean","default":false,"description":"JSON: sort the keys of every object alphabetically. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"restructure":{"type":"boolean","default":false,"description":"CSS minify: also merge rules that have the same declarations (smaller, the cascade is kept). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"format_inline":{"type":"boolean","default":true,"description":"HTML: format or minify the code inside <script> and <style> too (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"keyword_case":{"type":"string","enum":["upper","lower","keep"],"default":"upper","description":"SQL beautify: upper (default), lower or keep the letter case of keywords.","x-davix-h2i-enum":"DocumentsKeywordCase","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"final_newline":{"type":"boolean","default":true,"description":"true (default): end a beautified result with a line break.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/format-code.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ language, action, sizeBefore, sizeAfter, savedBytes, lines, url, sizeBytes, format, code? }","content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string","enum":["json","css","html","xml","sql","javascript"]},"action":{"type":"string","enum":["beautify","minify"]},"sizeBefore":{"type":"integer"},"sizeAfter":{"type":"integer"},"savedBytes":{"type":"integer","description":"Bytes saved (negative when beautifying makes it larger)."},"lines":{"type":"integer"},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"code":{"type":"string","description":"The result itself when it is at most 100 KB."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["language","action","sizeBefore","sizeAfter","savedBytes","lines","url","sizeBytes","format"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.format-code","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/format-code\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text={\"b\":1,\"a\":[1,2]}' \\\n  -F 'action=beautify' \\\n  -F 'language=json'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.formatCode({\n    \"text\": \"{\\\"b\\\":1,\\\"a\\\":[1,2]}\",\n    \"action\": \"beautify\",\n    \"language\": \"json\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->formatCode([\n    'text' => '{\"b\":1,\"a\":[1,2]}',\n    'action' => 'beautify',\n    'language' => 'json',\n]);\necho $result->requestId;"}]}},"/v1/documents/from-scan":{"post":{"operationId":"documents.from-scan","summary":"Scan to Word","description":"Turn scanned pages (photos or scans, or a scanned PDF) into a Word, OpenDocument, PDF, HTML, Markdown or text document with OCR. The paragraphs are rebuilt (wrapped lines joined, hyphenated words put back together, a page break between pages).","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The scanned pages: pictures (PNG, JPEG, WebP, TIFF ...) in page order, or one scanned PDF.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"to":{"type":"string","enum":["docx","odt","pdf","html","md","txt"],"default":"docx","description":"The document to make: docx (default), odt, pdf, html, md or txt.","x-davix-h2i-enum":"DocumentsFromScanTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/from-scan.js"}},"languages":{"type":"string","example":"eng+deu","description":"The languages to read, language codes joined with +, for example eng+deu (default: the server default).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-from-scan.js"}},"title":{"type":"string","description":"A heading to put at the top (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/from-scan.js"}},"join_lines":{"type":"boolean","default":true,"description":"true (default): join the wrapped lines of a paragraph. false keeps the line breaks of the scan.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/from-scan.js"}},"dehyphenate":{"type":"boolean","default":true,"description":"true (default): put words split by a hyphen at the end of a line back together.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/from-scan.js"}},"page_breaks":{"type":"boolean","default":true,"description":"true (default): start every scanned page on a new page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/from-scan.js"}},"font":{"type":"string","enum":["serif","sans","mono"],"default":"serif","description":"serif (default), sans or mono.","x-davix-h2i-enum":"DocumentsFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/from-scan.js"}},"font_size":{"type":"number","minimum":6,"maximum":40,"default":11,"description":"The text size in points, 6 to 40 (default 11).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/from-scan.js"}},"min_confidence":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"Warn about pages whose average recognition confidence is below this, 0 to 100 (default 0 = never).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/from-scan.js"}},"deskew":{"type":"boolean","default":false,"description":"true: straighten tilted scans before reading. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-from-scan.js"}},"denoise":{"type":"boolean","default":false,"description":"true: remove speckles before reading. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-from-scan.js"}},"clean":{"type":"boolean","default":false,"description":"true: boost contrast and clean the background before reading. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-from-scan.js"}},"psm":{"type":"integer","minimum":1,"maximum":13,"description":"The page layout mode of the OCR, 1 or 3 to 13 (default 3: a whole page).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-from-scan.js"}},"dpi":{"type":"integer","minimum":150,"maximum":400,"description":"The resolution of a PDF page when it is read, 150 to 400 (default 300); also the dpi told to the OCR for pictures.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-from-scan.js"}},"pages":{"type":"string","description":"A PDF: the pages to read, for example 1-3,5 (default all).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-from-scan.js"}},"force":{"type":"boolean","default":false,"description":"A PDF: read pages with OCR even when they already have a text layer. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-from-scan.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"files\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, pages, pagesOcred, paragraphs, words, confidence, languages, lowConfidencePages, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["docx","odt","pdf","html","md","txt"]},"pages":{"type":"integer"},"pagesOcred":{"type":"integer","description":"Pages that were read with OCR (the others already had text)."},"paragraphs":{"type":"integer"},"words":{"type":"integer"},"confidence":{"type":"number","description":"The average recognition confidence, 0 to 100, or null."},"languages":{"type":"array","items":{"type":"string"}},"lowConfidencePages":{"type":"array","items":{"type":"integer"},"description":"Page numbers below min_confidence."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","pages","pagesOcred","paragraphs","words","languages","lowConfidencePages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"files","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.from-scan","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/from-scan\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'to=docx' \\\n  -F 'languages=eng+deu' \\\n  -F 'font=serif'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.fromScan({\n    \"files\": 'document.pdf',\n    \"to\": \"docx\",\n    \"languages\": \"eng+deu\",\n    \"font\": \"serif\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->fromScan([\n    'files' => 'document.pdf',\n    'to' => 'docx',\n    'languages' => 'eng+deu',\n    'font' => 'serif',\n]);\necho $result->requestId;"}]}},"/v1/documents/invoice":{"post":{"operationId":"documents.invoice","summary":"Invoice and receipt maker","description":"Make an invoice, receipt, credit note or quote as a PDF from the seller, the buyer, the lines and the terms. Totals, tax and discounts are added up exactly and returned, in any currency and any language.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"invoice":{"type":"object","example":"{\"number\":\"INV-001\",\"date\":\"2026-11-16\",\"currency\":\"USD\",\"seller\":{\"name\":\"Acme\"},\"buyer\":{\"name\":\"Jo\"},\"items\":[{\"description\":\"Design\",\"quantity\":2,\"unit_price\":150,\"tax_rate\":10}]}","description":"The invoice data: { number, date, due_date, currency, seller: { name, address, email, phone, tax_id, logo }, buyer: { ... }, items: [{ description, detail, quantity, unit, unit_price, tax_rate, discount }], tax_rate, tax_included, discount_percent, discount_amount, shipping, amount_paid, notes, terms, payment, reference }. Dates are YYYY-MM-DD; logo is a small data:image/png;base64 picture.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Missing invoice -> 400 missing_field; no items, a line without unit_price, a bad date, currency or colour -> 400. Up to 200 lines.","evidence":"src/processing/documents/invoice.js"}},"type":{"type":"string","enum":["invoice","receipt","credit_note","quote"],"default":"invoice","description":"invoice (default), receipt, credit_note or quote. It changes the title and the words used.","x-davix-h2i-enum":"DocumentsInvoiceType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/invoice.js"}},"format":{"type":"string","enum":["pdf","html"],"default":"pdf","description":"pdf (default) or html (the same page as a web page).","x-davix-h2i-enum":"DocumentsFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/invoice.js"}},"template":{"type":"string","enum":["classic","modern","minimal"],"default":"classic","description":"The look: classic (default), modern or minimal.","x-davix-h2i-enum":"DocumentsInvoiceTemplate","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/invoice.js"}},"accent":{"type":"string","format":"color","default":"#2563eb","example":"#0f766e","description":"The main colour, a hex colour (default #2563eb). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/invoice.js"}},"locale":{"type":"string","default":"en-US","example":"de-DE","description":"How numbers and dates are written, a language tag such as en-US, de-DE, fr-FR or fa-IR (default en-US).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/invoice.js"}},"direction":{"type":"string","enum":["ltr","rtl"],"default":"ltr","description":"ltr (default) or rtl for right-to-left languages.","x-davix-h2i-enum":"Direction2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/invoice.js"}},"paper":{"type":"string","enum":["a4","letter"],"default":"a4","description":"a4 (default) or letter.","x-davix-h2i-enum":"Paper","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/invoice.js"}},"labels":{"type":"object","example":"{\"title\":\"Rechnung\"}","description":"Your own words for the headings, for example { \"title\": \"Rechnung\", \"total\": \"Gesamt\", \"due_amount\": \"Fällig\" }. The keys are title, number, date, due, from, to, description, quantity, unit, tax, discount, amount, subtotal, shipping, total, paid, due_amount, notes, terms, payment, taxid, reference, tax_incl.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/invoice.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["invoice"]},"encoding":{"invoice":{"contentType":"application/json"},"labels":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, type, number?, currency, subtotal, discount, tax, shipping, total, paid, due, taxBreakdown: [{ rate, base, tax }], lines }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"type":{"type":"string"},"number":{"type":"string"},"currency":{"type":"string"},"subtotal":{"type":"number","description":"The lines added up, before the invoice-level discount, tax and shipping."},"discount":{"type":"number"},"tax":{"type":"number"},"shipping":{"type":"number"},"total":{"type":"number","description":"What the invoice comes to: subtotal minus discount plus tax plus shipping."},"paid":{"type":"number"},"due":{"type":"number","description":"total minus the amount already paid."},"taxBreakdown":{"type":"array","items":{"type":"object"},"description":"One entry per tax rate: rate (percent), base (the amount taxed) and tax."},"lines":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","type","currency","subtotal","discount","tax","shipping","total","paid","due","taxBreakdown","lines"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"documents.invoice","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/invoice\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'invoice={\"number\":\"INV-001\",\"date\":\"2026-11-16\",\"currency\":\"USD\",\"seller\":{\"name\":\"Acme\"},\"buyer\":{\"name\":\"Jo\"},\"items\":[{\"description\":\"Design\",\"quantity\":2,\"unit_price\":150,\"tax_rate\":10}]}' \\\n  -F 'type=invoice' \\\n  -F 'format=pdf'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.invoice({\n    \"invoice\": \"{\\\"number\\\":\\\"INV-001\\\",\\\"date\\\":\\\"2026-11-16\\\",\\\"currency\\\":\\\"USD\\\",\\\"seller\\\":{\\\"name\\\":\\\"Acme\\\"},\\\"buyer\\\":{\\\"name\\\":\\\"Jo\\\"},\\\"items\\\":[{\\\"description\\\":\\\"Design\\\",\\\"quantity\\\":2,\\\"unit_price\\\":150,\\\"tax_rate\\\":10}]}\",\n    \"type\": \"invoice\",\n    \"format\": \"pdf\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->invoice([\n    'invoice' => '{\"number\":\"INV-001\",\"date\":\"2026-11-16\",\"currency\":\"USD\",\"seller\":{\"name\":\"Acme\"},\"buyer\":{\"name\":\"Jo\"},\"items\":[{\"description\":\"Design\",\"quantity\":2,\"unit_price\":150,\"tax_rate\":10}]}',\n    'type' => 'invoice',\n    'format' => 'pdf',\n]);\necho $result->requestId;"}]}},"/v1/documents/link-preview":{"post":{"operationId":"documents.link-preview","summary":"Link preview","description":"Get what a chat app or social network shows for a web address: the title, description, picture, site name, icon, type and the address the page really lives at. Give a web address or the page source.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"example":"https://example.com/blog/my-post","description":"The web address of the page, starting with https:// or http://. Use this or html.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Neither url nor html -> 400 missing_field; both -> 400. A private, local or blocked address, a host not on the server's allowed list, or URL input switched off for the plan -> 400 / 403. The page is fetched by the same guarded downloader as every URL input: public http(s) addresses only, redirects re-checked, 5 MB at most. A link to a picture or file is answered with its type and size (kind image or file).","evidence":"src/processing/web/link-preview.js"}},"html":{"type":"string","maxLength":5000000,"description":"The page source as text, instead of a web address.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/link-preview.js"}},"base_url":{"type":"string","example":"https://example.com/blog/","description":"With html: the address the page came from, so relative picture and icon addresses become full addresses.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/link-preview.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}}}}},"responses":{"200":{"description":"{ requestedUrl?, finalUrl?, kind, title, description, image?, imageAlt?, site, type?, canonical?, favicon?, language?, author?, published?, themeColor?, twitterCard?, sources, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"requestedUrl":{"type":"string","description":"The address you asked for (url only)."},"finalUrl":{"type":"string","description":"The address the page was fetched from, after redirects (url only)."},"status":{"type":"integer"},"kind":{"type":"string","description":"page, image or file."},"title":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","description":"The full address of the preview picture (og:image or twitter:image). It is not downloaded."},"imageAlt":{"type":"string"},"site":{"type":"string"},"type":{"type":"string"},"canonical":{"type":"string"},"favicon":{"type":"string"},"language":{"type":"string"},"author":{"type":"string"},"published":{"type":"string"},"themeColor":{"type":"string"},"twitterCard":{"type":"string"},"contentType":{"type":"string","description":"kind image or file: the type the address serves."},"sizeBytes":{"type":"integer"},"sources":{"type":"array","items":{"type":"string"},"description":"Where each value came from, for example title:og, image:twitter, description:page."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["kind","sources"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"documents.link-preview","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/link-preview\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'url=https://example.com/blog/my-post' \\\n  -F 'html=<h1>Hello</h1>' \\\n  -F 'base_url=https://example.com/blog/'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.linkPreview({\n    \"url\": \"https://example.com/blog/my-post\",\n    \"html\": \"<h1>Hello</h1>\",\n    \"base_url\": \"https://example.com/blog/\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->linkPreview([\n    'url' => 'https://example.com/blog/my-post',\n    'html' => '<h1>Hello</h1>',\n    'base_url' => 'https://example.com/blog/',\n]);\necho $result->requestId;"}]}},"/v1/documents/mail-merge":{"post":{"operationId":"documents.mail-merge","summary":"Fill a DOCX / ODT template with data (mail merge)","description":"Replace {{field}} placeholders in a DOCX or ODT template with the values of one record, or one document per record. Values are escaped, nothing in the template is executed (no macros, fields or expressions).","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"The template (DOCX or ODT) with {{field}} placeholders. Placeholders may be split over formatting runs; headers, footers and footnotes are filled too. Send the file or the id of a saved template (templateId).","x-davix-h2i-conflicts-with":["templateId"],"x-davix-h2i-file":{"note":"Macro-enabled Office files, binary Office files that contain macros or link other files, and RTF with external links / DDE are rejected (400). Size limits are plan/settings limits. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"templateId":{"type":"string","format":"uuid","description":"Merge a saved DOCX / ODT template instead of uploading a file (create one with POST /v1/templates/upload). Fill it with `data` (one document), `records` or `data_file`; a default of the template fills what a record leaves empty and a required variable that stays empty is refused. Send templateId or file, not both. Requires an individual customer API key.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown, someone else's or wrong-kind template -> 400 invalid_parameter.","evidence":"src/processing/templates/service.js"},"x-davix-h2i-conflicts-with":["file"]},"data_file":{"type":"string","format":"binary","description":"Records as a CSV, JSON, XLSX, TSV, YAML ... file: one document per row.","x-davix-h2i-file":{"note":"Send exactly one of records, data or data_file."}},"records":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true},"description":"One object per document: [{\"name\":\"Ada\",\"city\":\"London\"}, ...] (at most 200). How many records one request may carry, and how they count toward the quota, is set per plan.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/mail-merge.js"}},"data":{"type":"object","properties":{},"additionalProperties":true,"description":"One record, for a single document.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/mail-merge.js"}},"to":{"type":"string","enum":["docx","odt","pdf"],"description":"docx, odt or pdf (default: the template type).","x-davix-h2i-enum":"DocumentsMailMergeTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-extra.js"}},"strict":{"type":"boolean","default":false,"description":"true: refuse the request when a placeholder has no value in some record (the answer lists them); false (default): such placeholders are left empty and listed in warnings.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-extra.js"}},"password":{"type":"string","maxLength":256,"description":"Password of an encrypted template; used only to open it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/document-engine.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"records":{"contentType":"application/json"},"data":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, record, filled }], warnings? } — one result per record.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"record":{"type":"integer"},"filled":{"type":"integer"}},"required":["url","format","sizeBytes","record","filled"]}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.mail-merge","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","records_per_request","records_per_unit"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/mail-merge\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'to=docx' \\\n  -F 'response=url' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.mailMerge({\n    \"to\": \"docx\",\n    \"response\": \"url\",\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->mailMerge([\n    'to' => 'docx',\n    'response' => 'url',\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/documents/media":{"post":{"operationId":"documents.media","summary":"Extract media","description":"List the pictures, sounds and videos inside a Word, Excel, PowerPoint or OpenDocument file, with their size, picture dimensions and where they are used, or take them out into a ZIP, once each if you like.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The file to read: A Word (.docx), Excel (.xlsx), PowerPoint (.pptx) or OpenDocument (.odt, .ods, .odp) file.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["list","extract"],"default":"list","description":"list (default) or extract (a ZIP of the media files).","x-davix-h2i-enum":"DocumentsMediaOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-media.js"}},"kind":{"type":"string","enum":["all","image","audio","video"],"default":"all","description":"all (default), image, audio or video.","x-davix-h2i-enum":"DocumentsMediaKind","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-media.js"}},"formats":{"type":"array","example":"[\"png\",\"jpg\"]","items":{"type":"string"},"description":"Only these file types, as a list or comma-separated: png, jpg, mp3, mp4 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-media.js"}},"min_bytes":{"type":"integer","minimum":0,"maximum":1000000000,"default":0,"description":"Skip files smaller than this many bytes (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-media.js"}},"unique":{"type":"boolean","default":false,"description":"extract: take identical files out only once. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-media.js"}},"names":{"type":"string","enum":["original","numbered","by-part"],"default":"original","description":"extract: the names in the ZIP: original (default), numbered (image-001.png) or by-part (a folder for the slide or part that uses it).","x-davix-h2i-enum":"DocumentsNames","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-media.js"}},"details":{"type":"boolean","default":true,"description":"true (default): read the width and height of pictures.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-media.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"formats":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"list: { operation, kind, found, matched, unique, bytes, byKind, items: [{ path, name, kind, format, bytes, sha256, usedIn, width?, height?, duplicateOf? }] }. extract: the same plus { url, sizeBytes, format, extracted } and each item has `file`.","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","enum":["list","extract"]},"kind":{"type":"string","description":"The kind of Office file: docx, xlsx, pptx, odt, ods or odp."},"found":{"type":"integer"},"matched":{"type":"integer"},"unique":{"type":"integer"},"bytes":{"type":"integer"},"byKind":{"type":"object","description":"How many images, audio and video files matched."},"items":{"type":"array","items":{"type":"object"},"description":"Every file: path (inside the file), name, kind, format, bytes, sha256 (first 16 digits), usedIn (for example \"slide 3\" or \"body\"), width and height of pictures, duplicateOf (the path of an identical file) and, with extract, file (its name in the ZIP)."},"url":{"type":"string","format":"uri","description":"extract: the ZIP."},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"extracted":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["operation","kind","found","matched","unique","bytes","byKind","items"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.media","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/media\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=list' \\\n  -F 'kind=all' \\\n  -F 'formats=[\"png\",\"jpg\"]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.media({\n    \"file\": 'document.pdf',\n    \"operation\": \"list\",\n    \"kind\": \"all\",\n    \"formats\": \"[\\\"png\\\",\\\"jpg\\\"]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->media([\n    'file' => 'document.pdf',\n    'operation' => 'list',\n    'kind' => 'all',\n    'formats' => '[\"png\",\"jpg\"]',\n]);\necho $result->requestId;"}]}},"/v1/documents/merge":{"post":{"operationId":"documents.merge","summary":"Merge documents","description":"Join documents of different kinds (Word, Excel, PowerPoint, OpenDocument, text, Markdown, HTML, PDF and pictures) into one PDF, in the order you give them, with an optional bookmark for each file.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":2,"description":"The files to join, in order. Each is turned into pages of the PDF.","x-davix-h2i-file":{"note":"Any file type. The number of files and the size limits are plan/settings limits (runtime)."}},"bookmarks":{"type":"boolean","default":false,"description":"true: add a bookmark for each source file at its first page. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-merge.js"}},"titles":{"type":"array","example":"[\"Cover\",\"Contract\",\"Annex\"]","items":{"type":"string"},"description":"The bookmark titles, one per file in the same order (default: the file names).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-merge.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"titles":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format: \"pdf\", pages, parts: [{ name, kind, pages, firstPage }], warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"pages":{"type":"integer"},"parts":{"type":"array","items":{"type":"object"},"description":"One per source file: name, kind (pdf, image or the document type), pages and firstPage."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","pages","parts"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":2,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"documents.merge","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/merge\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'bookmarks=false' \\\n  -F 'titles=[\"Cover\",\"Contract\",\"Annex\"]' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.merge({\n    \"files\": 'document.pdf',\n    \"bookmarks\": false,\n    \"titles\": \"[\\\"Cover\\\",\\\"Contract\\\",\\\"Annex\\\"]\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->merge([\n    'files' => 'document.pdf',\n    'bookmarks' => false,\n    'titles' => '[\"Cover\",\"Contract\",\"Annex\"]',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/documents/metadata":{"post":{"operationId":"documents.metadata","summary":"Read, edit or remove the metadata of Word, Excel, PowerPoint and OpenDocument files","description":"With nothing asked it lists every property of a DOCX, XLSX, PPTX, ODT, ODS or ODP file: Core (title, author, dates ...), Extended (application, company, counts ...), Custom, Thumbnail, and the names of the people who commented or tracked changes (Revisions). With clean, mode, remove, remove_groups or set it returns a new file with the change; the text, tables, slides and formatting are never touched. Older .doc, .xls, .ppt and RTF files can be read, not changed.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The document. DOCX, XLSX, PPTX, ODT, ODS and ODP can be read and changed; .doc, .xls, .ppt and RTF can only be read.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/rtf","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint"],"extensions":["docx","xlsx","pptx","odt","ods","odp","rtf","doc","dot","xls","xlt","ppt","pot"],"note":"Accepted source types (detected from content): pdf, docx, odt, rtf, doc, xlsx, ods, xls, pptx, ppsx, odp, ppt, pps, odg, wpd (WordPerfect), wps (Works word processor), vsd, vsdx (Visio), djvu (DjVu scan), xps (XPS), html, txt, md, epub; text sources (html, txt, md, tex, rst, mediawiki, fb2, adoc, eml, msg) are declared with `from`. Macro-enabled Office files, binary Office files that contain macros or link other files, and RTF with external links / DDE are rejected (400). Size limits are plan/settings limits. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"mode":{"type":"string","enum":["read","merge","replace","strip","keep"],"description":"read (default when nothing else is asked): list every tag. merge (default when something is asked): apply remove / remove_groups / set / clean and keep the rest. replace: remove everything, then write the tags in `set`. keep: return the file as it is, as a new result (so a request with several files returns every one of them). strip: remove everything (the file keeps looking and opening exactly as before).","x-davix-h2i-enum":"Mode","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown mode -> 400 invalid_parameter. read cannot be combined with changes; strip cannot be combined with remove, remove_groups, set or a partial clean.","evidence":"src/processing/metadata/request.js"}},"clean":{"type":"string","enum":["all","location","personal"],"description":"A ready-made removal: all (= mode=strip), location (GPS position and place names) or personal (location, author and owner names, serial numbers, software, company, document ids).","x-davix-h2i-enum":"Clean","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"remove":{"type":"array","items":{"type":"string"},"description":"Tags to remove: a JSON array or a comma-separated list of names as listed by a read, e.g. [\"EXIF:Artist\", \"GPS:GPSLatitude\"] (a name without a group matches in every group; * works as a wildcard).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 200 entries or a malformed name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"remove_groups":{"type":"array","items":{"type":"string"},"description":"Whole groups of tags to remove, e.g. [\"GPS\", \"XMP\", \"IPTC\"] (documents: Core, Extended, Custom, Thumbnail, Revisions).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 200 entries or a malformed group name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"set":{"type":"object","description":"Tags to write, as { \"Group:Tag\": \"value\" } (e.g. {\"EXIF:Artist\": \"Jane\"}; documents: {\"Title\": \"Report\", \"Custom:Project\": \"X-9\"}). A tag the format cannot hold is reported in `report.warnings`.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A non-object, nested values, more than 200 entries, a value over 4000 characters or a malformed name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ format, sourceFormat, characters, text | data | url, pages?, sizeBytes?, warnings? }","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"originalName":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"writable":{"type":"boolean","description":"Whether this format can be changed (false = read only)."},"tags":{"type":"array","items":{"$ref":"#/components/schemas/MetadataTag"},"description":"Every tag of the file."},"total":{"type":"integer"},"editableCount":{"type":"integer"},"groups":{"type":"array","items":{"type":"object"},"description":"Tag groups with their counts: { name, count }."},"risks":{"type":"object","additionalProperties":true,"description":"What the tags can reveal: location, personal, device, identifier, thumbnail, dates."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}}},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"originalName":{"type":"string","nullable":true},"report":{"$ref":"#/components/schemas/MetadataReport"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","format","sizeBytes"]}],"description":"Read (nothing asked) -> every property of the file; change -> {url} of the new file and a report."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dependency_unavailable","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.metadata","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/metadata\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'mode=read' \\\n  -F 'clean=all' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.metadata({\n    \"file\": 'document.pdf',\n    \"mode\": \"read\",\n    \"clean\": \"all\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->metadata([\n    'file' => 'document.pdf',\n    'mode' => 'read',\n    'clean' => 'all',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/documents/outline":{"post":{"operationId":"documents.outline","summary":"Speaker notes and outline","description":"The structure of an Office file as data: the headings of a Word or OpenDocument text (optionally numbered, with word counts), the slides of a presentation with their titles, text and speaker notes, or the sheets of a workbook; as JSON, Markdown or plain text.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The file to read: A Word (.docx), Excel (.xlsx), PowerPoint (.pptx) or OpenDocument (.odt, .ods, .odp) file.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"output":{"type":"string","enum":["json","markdown","text"],"default":"json","description":"json (default: the answer itself), markdown or text (a file).","x-davix-h2i-enum":"DocumentsOutlineOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-outline.js"}},"max_level":{"type":"integer","minimum":1,"maximum":9,"default":9,"description":"Word and OpenDocument text: the deepest heading level to list, 1 to 9 (default 9).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-outline.js"}},"numbering":{"type":"boolean","default":false,"description":"Word and OpenDocument text: number the headings 1, 1.1, 1.2, 2 ... Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-outline.js"}},"word_counts":{"type":"boolean","default":false,"description":"Word and OpenDocument text: count the words under every heading. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-outline.js"}},"notes":{"type":"boolean","default":true,"description":"PowerPoint: include the speaker notes (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-outline.js"}},"slide_text":{"type":"boolean","default":false,"description":"PowerPoint: include the text of each slide, with its bullet level. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-outline.js"}},"include_hidden":{"type":"boolean","default":true,"description":"PowerPoint slides and Excel sheets: include the hidden ones (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-outline.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ kind, output, counts: { headings, slides, sheets, notes }, headings?: [{ level, text, number?, words? }], introWords?, slides?: [{ slide, title, hidden, text?, notes? }], sheets?: [{ sheet, name, hidden, state, range, rows }], url?, sizeBytes?, format? }","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string"},"output":{"type":"string","enum":["json","markdown","text"]},"counts":{"type":"object","description":"headings, slides, sheets and notes found."},"headings":{"type":"array","items":{"type":"object"},"description":"Word and OpenDocument text: level, text and, when asked, number and words."},"introWords":{"type":"integer","description":"Words before the first heading."},"slides":{"type":"array","items":{"type":"object"},"description":"Presentations: slide number, title, hidden and, when asked, text (level and text) and notes."},"sheets":{"type":"array","items":{"type":"object"},"description":"Workbooks: sheet, name, hidden, state, range and rows."},"url":{"type":"string","format":"uri","description":"With output markdown or text: the file."},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["kind","output","counts"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.outline","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/outline\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'output=json' \\\n  -F 'max_level=9' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.outline({\n    \"file\": 'document.pdf',\n    \"output\": \"json\",\n    \"max_level\": 9,\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->outline([\n    'file' => 'document.pdf',\n    'output' => 'json',\n    'max_level' => 9,\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/documents/preview":{"post":{"operationId":"documents.preview","summary":"Page thumbnails of a document","description":"Render pages of any supported document as images (through PDF): the first page by default, or the pages you ask for.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The document.","x-davix-h2i-file":{"mimeTypes":["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/rtf","application/epub+zip","text/plain","text/markdown","text/html","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.ms-works","application/vnd.wordperfect","application/vnd.visio","application/vnd.ms-visio.drawing","image/vnd.djvu","application/vnd.ms-xpsdocument","application/vnd.oasis.opendocument.graphics","message/rfc822","application/vnd.ms-outlook","application/x-tex","text/x-rst","text/asciidoc","application/x-fictionbook+xml","text/x-mediawiki"],"extensions":["pdf","docx","xlsx","pptx","odt","ods","odp","rtf","epub","txt","text","md","markdown","html","htm","xhtml","doc","dot","xls","xlt","ppt","pot","pps","ppsx","wps","wpd","wp","vsd","vsdx","djvu","djv","xps","oxps","odg","eml","msg","tex","latex","rst","adoc","asciidoc","fb2","wiki","mediawiki"],"note":"Accepted source types (detected from content): pdf, docx, odt, rtf, doc, xlsx, ods, xls, pptx, ppsx, odp, ppt, pps, odg, wpd (WordPerfect), wps (Works word processor), vsd, vsdx (Visio), djvu (DjVu scan), xps (XPS), html, txt, md, epub; text sources (html, txt, md, tex, rst, mediawiki, fb2, adoc, eml, msg) are declared with `from`. Macro-enabled Office files, binary Office files that contain macros or link other files, and RTF with external links / DDE are rejected (400). Size limits are plan/settings limits. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"password":{"type":"string","maxLength":256,"description":"Password of an encrypted Office file; used only to open it, never logged or stored.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/document-engine.js"}},"pages":{"type":"string","description":"Pages to render: \"first\" (default), \"all\", or numbers and ranges such as \"1,3-5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-extra.js"}},"width":{"type":"integer","minimum":1,"default":400,"description":"Image width in pixels (default 400); the height follows the page shape.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-extra.js"}},"format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"png (default), jpeg or webp.","x-davix-h2i-enum":"Format","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-extra.js"}},"dpi":{"type":"integer","minimum":1,"description":"Rendering density (default 150); a plan may cap it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-extra.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ pages, results: [{ url, format, sizeBytes, width, height, pageNumber }], warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"pages":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"pageNumber":{"type":"integer"}},"required":["url","format","sizeBytes","pageNumber"]}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["pages","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.preview","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_email","allow_fmt_legacy_office","allow_fmt_markup_text","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/preview\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'width=400' \\\n  -F 'format=png' \\\n  -F 'dpi=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.preview({\n    \"file\": 'document.pdf',\n    \"width\": 400,\n    \"format\": \"png\",\n    \"dpi\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->preview([\n    'file' => 'document.pdf',\n    'width' => 400,\n    'format' => 'png',\n    'dpi' => 1,\n]);\necho $result->requestId;"}]}},"/v1/documents/protect":{"post":{"operationId":"documents.protect","summary":"Protect / unprotect Office file","description":"Give a Word, Excel or PowerPoint file an opening password (AES-256 Office encryption) or take it off with the password, mark a file read-only recommended, remove editing restrictions that have no password, or check what protection a file has.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The file: A Word (.docx), Excel (.xlsx) or PowerPoint (.pptx) file.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["status","encrypt","decrypt","restrict","unrestrict"],"default":"status","description":"status (default: report the protection), encrypt (opening password), decrypt (remove it), restrict (read-only recommended, Word and Excel) or unrestrict (remove that and editing restrictions that have no password).","x-davix-h2i-enum":"DocumentsProtectOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-protect.js"}},"password":{"type":"string","example":"a long passphrase","description":"encrypt and decrypt: the password (at most 256 characters; at least 4 to encrypt). It is never stored, logged or returned.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-protect.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"status: { operation, encrypted, kind?, container?, restricted?, readOnlyRecommended?, macros?, restrictions?, passwordRestrictions? }. encrypt / decrypt / restrict / unrestrict: { operation, url, sizeBytes, format, changed, encrypted?, verified?, algorithm?, partsChanged? }.","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","enum":["status","encrypt","decrypt","restrict","unrestrict"]},"encrypted":{"type":"boolean","description":"Whether the file (now) needs a password to open."},"kind":{"type":"string"},"container":{"type":"string","description":"status of an encrypted file: ole or zip."},"restricted":{"type":"boolean","description":"status: the file has editing restrictions."},"readOnlyRecommended":{"type":"boolean"},"macros":{"type":"boolean"},"restrictions":{"type":"array","items":{"type":"object"},"description":"status: every restriction: part, element, passwordProtected and, for Word, edit and enforced."},"passwordRestrictions":{"type":"integer","description":"status: how many restrictions are protected by a password."},"canDecrypt":{"type":"boolean"},"verified":{"type":"boolean","description":"encrypt: the encrypted file was decrypted again with the password and gave the original."},"algorithm":{"type":"string"},"changed":{"type":"boolean"},"partsChanged":{"type":"array","items":{"type":"string"}},"url":{"type":"string","format":"uri","description":"The resulting file (not with status)."},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"sizeBefore":{"type":"integer"},"sizeAfter":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["operation"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.protect","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/protect\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=status' \\\n  -F 'password=a long passphrase' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.protect({\n    \"file\": 'document.pdf',\n    \"operation\": \"status\",\n    \"password\": \"a long passphrase\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->protect([\n    'file' => 'document.pdf',\n    'operation' => 'status',\n    'password' => 'a long passphrase',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/documents/replace-text":{"post":{"operationId":"documents.replace-text","summary":"Find and replace in Office file","description":"Find and replace text in a Word, PowerPoint or Excel file even when the phrase is split over several runs of text; the replacement keeps the formatting of the run where the match starts.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The file to edit: A Word (.docx), PowerPoint (.pptx) or Excel (.xlsx) file.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"find":{"type":"string","example":"Acme Ltd","description":"The text to find (up to 300 characters). Plain text, never a pattern. Use rules for several pairs.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"replace":{"type":"string","example":"Acme Inc","description":"The text to put instead (up to 3000 characters; empty removes the text).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"rules":{"type":"array","example":"[{\"find\":\"2025\",\"replace\":\"2026\"}]","items":{"type":"object","properties":{"find":{"type":"string"},"replace":{"type":"string"}},"required":["find","replace"]},"description":"Several pairs at once: a list of { find, replace } (up to 50), applied in order. Used instead of find and replace.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"case_sensitive":{"type":"boolean","default":false,"description":"true: upper and lower case differ. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"whole_word":{"type":"boolean","default":false,"description":"true: only match whole words. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"headers_footers":{"type":"boolean","default":true,"description":"Word: also change headers and footers (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"footnotes":{"type":"boolean","default":true,"description":"Word: also change footnotes and endnotes (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"notes":{"type":"boolean","default":true,"description":"PowerPoint: also change the speaker notes (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"max_replacements":{"type":"integer","minimum":1,"maximum":100000,"default":10000,"description":"Stop after this many replacements, 1 to 100000 (default 10000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-replace.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"rules":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, replacements, paragraphsChanged, changed, truncated, byRule: [{ find, replace, count }], parts }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"replacements":{"type":"integer"},"paragraphsChanged":{"type":"integer"},"changed":{"type":"boolean"},"truncated":{"type":"boolean","description":"true when max_replacements stopped the work."},"byRule":{"type":"array","items":{"type":"object"},"description":"For every rule: find, replace and how many times it was applied."},"parts":{"type":"array","items":{"type":"string"},"description":"The parts of the file that were changed."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","replacements","paragraphsChanged","changed","truncated","byRule","parts"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.replace-text","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/replace-text\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'find=Acme Ltd' \\\n  -F 'replace=Acme Inc' \\\n  -F 'rules=[{\"find\":\"2025\",\"replace\":\"2026\"}]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.replaceText({\n    \"file\": 'document.pdf',\n    \"find\": \"Acme Ltd\",\n    \"replace\": \"Acme Inc\",\n    \"rules\": \"[{\\\"find\\\":\\\"2025\\\",\\\"replace\\\":\\\"2026\\\"}]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->replaceText([\n    'file' => 'document.pdf',\n    'find' => 'Acme Ltd',\n    'replace' => 'Acme Inc',\n    'rules' => '[{\"find\":\"2025\",\"replace\":\"2026\"}]',\n]);\necho $result->requestId;"}]}},"/v1/documents/scrape":{"post":{"operationId":"documents.scrape","summary":"Scrape with selectors","description":"Pick values, lists or records out of a web page with CSS selectors: the text, HTML or an attribute of every match, or a record per item of a list. The page is read as text, never run; the address is fetched with the same guard as every other URL input.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"url":{"type":"string","example":"https://example.com/products","description":"The web address of the page (public http or https). Send this or html.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-scrape.js"}},"html":{"type":"string","description":"The page source as text (instead of url).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-scrape.js"}},"base_url":{"type":"string","description":"The address that relative links are made absolute against (default: the address of the page).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"selector":{"type":"string","example":"ul.items li a","description":"A CSS selector: one value per match (a list). Send this or fields.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"extract":{"type":"string","enum":["text","html","outer_html","attribute"],"default":"text","description":"What to read from each match: text (default), html (inside), outer_html or attribute.","x-davix-h2i-enum":"DocumentsExtract","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"attribute":{"type":"string","description":"The attribute to read with extract=attribute, for example href or src.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"fields":{"type":"object","example":"{\"title\":\"h2\",\"price\":{\"selector\":\".price\",\"regex\":\"([0-9.]+)\"}}","description":"A record: { \"name\": \"selector\" } or { \"name\": { selector, extract?, attribute?, multiple?, regex?, default? } }. regex keeps its first group. With item_selector the selectors work inside each item.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"item_selector":{"type":"string","description":"With fields: the selector of one item of a list (a product, a table row); the answer has one record per item.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"remove":{"type":"array","items":{"type":"string"},"description":"Selectors to remove from the page before reading (up to 50), for example nav and footer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"absolute_urls":{"type":"boolean","default":true,"description":"true (default): turn href, src and similar attributes into full addresses.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"collapse_whitespace":{"type":"boolean","default":true,"description":"true (default): replace runs of white space in text with one space.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"unique":{"type":"boolean","default":false,"description":"true: leave out repeated values or records. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"skip_empty":{"type":"boolean","default":false,"description":"true: leave out empty values and records. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"limit":{"type":"integer","minimum":1,"maximum":5000,"default":500,"description":"Return at most this many values or records, 1 to 5000 (default 500).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"output":{"type":"string","enum":["json","csv","text"],"default":"json","description":"json (default: in the answer), csv or text: also write a file.","x-davix-h2i-enum":"DocumentsScrapeOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/scrape.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"fields":{"contentType":"application/json"},"remove":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ requestedUrl?, finalUrl?, status?, kind: values|records|record, count, total, truncated, results, warnings?, url?, sizeBytes?, format? }","content":{"application/json":{"schema":{"type":"object","properties":{"requestedUrl":{"type":"string"},"finalUrl":{"type":"string"},"status":{"type":"integer"},"kind":{"type":"string","enum":["values","records","record"]},"count":{"type":"integer"},"total":{"type":"integer","description":"How many matches there were before limit."},"truncated":{"type":"boolean"},"results":{"type":"array","items":{},"description":"The values (kind=values), the records (kind=records) or one record (kind=record)."},"warnings":{"type":"array","items":{"type":"string"}},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["kind","count","total","truncated","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"documents.scrape","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/scrape\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'url=https://example.com/products' \\\n  -F 'selector=ul.items li a' \\\n  -F 'extract=text'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.scrape({\n    \"url\": \"https://example.com/products\",\n    \"selector\": \"ul.items li a\",\n    \"extract\": \"text\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->scrape([\n    'url' => 'https://example.com/products',\n    'selector' => 'ul.items li a',\n    'extract' => 'text',\n]);\necho $result->requestId;"}]}},"/v1/documents/slides":{"post":{"operationId":"documents.slides","summary":"Markdown to slides","description":"Turn Markdown text into a slide deck: a PDF with one page per slide, or one HTML slideshow you can open in any browser. Slides are split at lines with --- (or at # and ## headings), code is coloured, speaker notes are kept out of the slides.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"markdown":{"type":"string","maxLength":300000,"example":"# My talk\n\n---\n\n## Why\n\n- Fast\n- Simple","description":"The text of the slides, in Markdown. A slide ends at a line with only ---; with no such line a new slide starts at every # or ## heading. A first slide with only a # heading becomes the title slide. Text after a \"Notes:\" line is the speaker notes (returned, not drawn).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Empty -> 400 missing_field. More than 150 slides -> 400. Raw HTML in the text is shown as text, never run. Only pictures written into the text as data:image/...;base64 are drawn; other pictures are left out (the answer says so).","evidence":"src/processing/documents/slides.js"}},"format":{"type":"string","enum":["pdf","html"],"default":"pdf","description":"pdf (default, one page per slide) or html (one self-contained slideshow: arrow keys, space and clicks move between slides, and it prints as a deck).","x-davix-h2i-enum":"DocumentsFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/slides.js"}},"theme":{"type":"string","enum":["light","dark","ocean","sunset","paper"],"default":"light","description":"The look: light (default), dark, ocean, sunset or paper.","x-davix-h2i-enum":"DocumentsTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/slides.js"}},"size":{"type":"string","enum":["16:9","4:3"],"default":"16:9","description":"The slide shape: 16:9 (default) or 4:3.","x-davix-h2i-enum":"DocumentsSize","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/slides.js"}},"split":{"type":"string","enum":["auto","rule","headings"],"default":"auto","description":"How the text is cut into slides: auto (default: at --- lines when there are any, else at # and ## headings), rule (only at --- lines) or headings (only at # and ## headings).","x-davix-h2i-enum":"DocumentsSplit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/slides.js"}},"title":{"type":"string","maxLength":200,"description":"The title of the document (shown in the viewer and the PDF details). Default: the first heading.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/slides.js"}},"slide_numbers":{"type":"boolean","default":true,"description":"true (default): show \"3 / 12\" on every slide except the title slide.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/slides.js"}},"font_size":{"type":"number","minimum":14,"maximum":60,"default":28,"description":"The size of the body text in pixels on a 1280-pixel-wide slide (default 28, 14 to 60). Headings scale with it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/slides.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["markdown"]}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, slideCount, slides: [{ index, title, layout, notes }], theme, size, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"slideCount":{"type":"integer"},"slides":{"type":"array","items":{"type":"object"},"description":"One per slide: index, title (its first heading), layout (title or content) and notes (the speaker notes, empty when there are none)."},"theme":{"type":"string"},"size":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","slideCount","slides","theme","size"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"documents.slides","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/slides\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'markdown=# My talk\n\n---\n\n## Why\n\n- Fast\n- Simple' \\\n  -F 'format=pdf' \\\n  -F 'theme=light'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.slides({\n    \"markdown\": \"# My talk\\n\\n---\\n\\n## Why\\n\\n- Fast\\n- Simple\",\n    \"format\": \"pdf\",\n    \"theme\": \"light\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->slides([\n    'markdown' => '# My talk\n\n---\n\n## Why\n\n- Fast\n- Simple',\n    'format' => 'pdf',\n    'theme' => 'light',\n]);\necho $result->requestId;"}]}},"/v1/documents/subtitles":{"post":{"operationId":"documents.subtitles","summary":"Subtitle convert","description":"Convert a subtitle file between SRT, WebVTT, ASS/SSA, SBV and LRC, or to plain text or JSON, with the times shifted or stretched for another frame rate.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The subtitle file: SRT, WebVTT, ASS/SSA, SBV or LRC (the format is recognised from the text).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"to":{"type":"string","enum":["srt","vtt","ass","sbv","lrc","txt","json"],"default":"srt","description":"The format to write: srt (default), vtt, ass, sbv, lrc, txt (text only) or json (every subtitle with its times).","x-davix-h2i-enum":"DocumentsSubtitlesTo","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"from":{"type":"string","enum":["auto","srt","vtt","ass","sbv","lrc"],"default":"auto","description":"The format of the file: auto (default, found from the text) or srt, vtt, ass, sbv, lrc.","x-davix-h2i-enum":"DocumentsFrom","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"encoding":{"type":"string","default":"auto","example":"windows-1256","description":"The text encoding of the file: auto (default: a byte order mark, then UTF-8, then Windows-1252) or a name such as utf-8, windows-1252, iso-8859-9, windows-1256.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"shift_ms":{"type":"integer","minimum":-86400000,"maximum":86400000,"default":0,"example":1500,"description":"Move every subtitle later (positive) or earlier (negative) by this many milliseconds.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"speed":{"type":"number","minimum":0.25,"maximum":4,"default":1,"description":"Stretch the times by this factor (1 = no change, 1.0427 = 23.976 to 25 fps).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"from_fps":{"type":"number","minimum":1,"maximum":240,"example":23.976,"description":"With to_fps: the frame rate the subtitles were made for (the stretch is worked out for you).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"to_fps":{"type":"number","minimum":1,"maximum":240,"example":25,"description":"With from_fps: the frame rate of the video they now go with.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"strip_formatting":{"type":"boolean","default":false,"description":"true: remove HTML-style tags (<i>, <b>, <font>) and ASS override codes from the text. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"drop_empty":{"type":"boolean","default":true,"description":"true (default): leave out subtitles that have no text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"min_gap_ms":{"type":"integer","minimum":0,"maximum":5000,"default":0,"description":"Trim a subtitle so that it ends at least this many milliseconds before the next one starts (0 = do not).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/subtitles.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, from, encoding, cues, durationMs, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"from":{"type":"string","description":"The format that was read."},"encoding":{"type":"string","description":"The text encoding that was used to read the file."},"cues":{"type":"integer","description":"How many subtitles the result has."},"durationMs":{"type":"integer","description":"Where the last subtitle ends, in milliseconds."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","from","encoding","cues","durationMs"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.subtitles","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/subtitles\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'to=srt' \\\n  -F 'from=auto' \\\n  -F 'encoding=windows-1256'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.subtitles({\n    \"file\": 'document.pdf',\n    \"to\": \"srt\",\n    \"from\": \"auto\",\n    \"encoding\": \"windows-1256\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->subtitles([\n    'file' => 'document.pdf',\n    'to' => 'srt',\n    'from' => 'auto',\n    'encoding' => 'windows-1256',\n]);\necho $result->requestId;"}]}},"/v1/documents/template":{"post":{"operationId":"documents.template","summary":"Fill an Excel or PowerPoint template","description":"Fill an Excel, PowerPoint or Word template: every {{placeholder}} in it is replaced with a value from a JSON object, including placeholders that Office split across several pieces of text.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The template: an .xlsx, .pptx or .docx file with {{name}} placeholders. Macro-enabled files are refused.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"data":{"type":"object","example":"{\"name\":\"Ada\",\"total\":12.5}","description":"The values, as a JSON object: {\"customer\":{\"name\":\"Ada\"},\"total\":12.5}. A placeholder is a path into it: {{customer.name}}, {{items.0.price}}.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Missing data -> 400 missing_field; not valid JSON or not an object -> 400.","evidence":"src/processing/documents/office-template.js"}},"missing":{"type":"string","enum":["keep","blank","error"],"default":"keep","description":"What to do with a placeholder that has no value: keep (default, left as written, and listed in the answer), blank (replaced by nothing) or error (the request fails).","x-davix-h2i-enum":"DocumentsMissing","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/office-template.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","data"]},"encoding":{"data":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, mimeType, replacements, placeholders: { filled[], missing[] }, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","description":"xlsx, pptx or docx."},"mimeType":{"type":"string"},"replacements":{"type":"integer","description":"How many placeholders were replaced."},"placeholders":{"type":"object","description":"filled: the placeholders that got a value; missing: the ones the data did not have."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","mimeType","replacements","placeholders"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.template","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/template\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'data={\"name\":\"Ada\",\"total\":12.5}' \\\n  -F 'missing=keep' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.template({\n    \"file\": 'document.pdf',\n    \"data\": \"{\\\"name\\\":\\\"Ada\\\",\\\"total\\\":12.5}\",\n    \"missing\": \"keep\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->template([\n    'file' => 'document.pdf',\n    'data' => '{\"name\":\"Ada\",\"total\":12.5}',\n    'missing' => 'keep',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/documents/text":{"post":{"operationId":"documents.text","summary":"Extract the text of a document","description":"The text of any supported document as plain text, Markdown or a structured JSON view (headings, paragraphs, lists, tables; pages for PDFs and presentations).","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The document.","x-davix-h2i-file":{"mimeTypes":["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/rtf","application/epub+zip","text/plain","text/markdown","text/html","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.ms-works","application/vnd.wordperfect","application/vnd.visio","application/vnd.ms-visio.drawing","image/vnd.djvu","application/vnd.ms-xpsdocument","application/vnd.oasis.opendocument.graphics","message/rfc822","application/vnd.ms-outlook","application/x-tex","text/x-rst","text/asciidoc","application/x-fictionbook+xml","text/x-mediawiki"],"extensions":["pdf","docx","xlsx","pptx","odt","ods","odp","rtf","epub","txt","text","md","markdown","html","htm","xhtml","doc","dot","xls","xlt","ppt","pot","pps","ppsx","wps","wpd","wp","vsd","vsdx","djvu","djv","xps","oxps","odg","eml","msg","tex","latex","rst","adoc","asciidoc","fb2","wiki","mediawiki"],"note":"Accepted source types (detected from content): pdf, docx, odt, rtf, doc, xlsx, ods, xls, pptx, ppsx, odp, ppt, pps, odg, wpd (WordPerfect), wps (Works word processor), vsd, vsdx (Visio), djvu (DjVu scan), xps (XPS), html, txt, md, epub; text sources (html, txt, md, tex, rst, mediawiki, fb2, adoc, eml, msg) are declared with `from`. Macro-enabled Office files, binary Office files that contain macros or link other files, and RTF with external links / DDE are rejected (400). Size limits are plan/settings limits. The format is recognised from the file itself (its content, then its name); there is no source-format parameter. A file in an unsupported format -> 400 invalid_parameter naming the supported formats. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"password":{"type":"string","maxLength":256,"description":"Password of an encrypted Office file; used only to open it, never logged or stored.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/document-engine.js"}},"format":{"type":"string","enum":["txt","md","json"],"default":"txt","description":"txt (default): plain text; md: Markdown (word-processing documents, spreadsheets, HTML, Markdown, text); json: a structured view ({ blocks } or { pages }).","x-davix-h2i-enum":"DocumentsTextFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text.js"}},"output":{"type":"string","enum":["inline","url"],"default":"inline","description":"inline (default): the text is in the answer; url: the text is written to a file. Text over 5 MB is always returned as a file.","x-davix-h2i-enum":"DocumentsTextOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-extra.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ format, sourceFormat, characters, text | data | url, pages?, sizeBytes?, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","enum":["txt","md","json"]},"sourceFormat":{"type":"string"},"characters":{"type":"integer"},"text":{"type":"string"},"data":{},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"pages":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["format","sourceFormat","characters"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.text","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_email","allow_fmt_legacy_office","allow_fmt_markup_text","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/text\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'format=txt' \\\n  -F 'output=inline' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.text({\n    \"file\": 'document.pdf',\n    \"format\": \"txt\",\n    \"output\": \"inline\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->text([\n    'file' => 'document.pdf',\n    'format' => 'txt',\n    'output' => 'inline',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/documents/text-diff":{"post":{"operationId":"documents.text-diff","summary":"Compare text","description":"Compare two texts (as parameters, or as two text files) by line, word, character or sentence: a unified patch, the list of changes with line numbers, a similarity score and an optional page that shows the changes in colour.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"The first text file, instead of the parameter a.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"other":{"type":"string","format":"binary","description":"The second text file, instead of the parameter b.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime)."}},"a":{"type":"string","example":"one\ntwo\nthree","description":"The first text (the older one), instead of a file (up to 2,000,000 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"b":{"type":"string","example":"one\n2\nthree","description":"The second text (the newer one), instead of a file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"mode":{"type":"string","enum":["line","word","char","sentence"],"default":"line","description":"line (default), word, char or sentence: the size of the pieces that are compared.","x-davix-h2i-enum":"DocumentsTextDiffMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"ignore_case":{"type":"boolean","default":false,"description":"true: treat capital and small letters as the same. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"ignore_whitespace":{"type":"boolean","default":false,"description":"true: ignore differences in spaces and tabs. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"ignore_blank_lines":{"type":"boolean","default":false,"description":"true: leave out empty lines before comparing. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"trim_trailing":{"type":"boolean","default":false,"description":"true: ignore spaces at the end of a line. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"context":{"type":"integer","minimum":0,"maximum":100,"default":3,"description":"Unchanged lines to show around a change in the unified patch, 0 to 100 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"unified":{"type":"boolean","default":true,"description":"true (default): include the unified patch (as `git diff` writes it).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"label_a":{"type":"string","example":"old.txt","description":"The name of the first text in the patch header (default: the file name, or a).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"label_b":{"type":"string","example":"new.txt","description":"The name of the second text in the patch header (default: the file name, or b).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"max_changes":{"type":"integer","minimum":1,"maximum":2000,"default":500,"description":"The most changes to list, 1 to 2000 (default 500). The counts are always complete.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"report":{"type":"boolean","default":false,"description":"true: also make a page that shows the changes in colour (reportUrl). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/text-diff.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ identical, similarity, mode, stats: { added, removed, unchanged, unit, changes }, changes: [{ type, text, aLine?, bLine?, lines? }], truncated?, unified?, reportUrl?, reportBytes? }","content":{"application/json":{"schema":{"type":"object","properties":{"identical":{"type":"boolean"},"similarity":{"type":"number","description":"The share of the text both have in common, in percent."},"mode":{"type":"string","enum":["line","word","char","sentence"]},"stats":{"type":"object","description":"added, removed and unchanged (in lines for mode=line, otherwise in characters), unit and the number of changes listed."},"changes":{"type":"array","items":{"type":"object"},"description":"Each change: type (added or removed), text and, for mode=line, the line number (aLine for removed text, bLine for added text) and the number of lines."},"truncated":{"type":"boolean"},"unified":{"type":"string","description":"The unified patch."},"reportUrl":{"type":"string","format":"uri"},"reportBytes":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["identical","similarity","mode","stats","changes"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.text-diff","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/text-diff\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'a=one\ntwo\nthree' \\\n  -F 'b=one\n2\nthree' \\\n  -F 'mode=line'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.textDiff({\n    \"a\": \"one\\ntwo\\nthree\",\n    \"b\": \"one\\n2\\nthree\",\n    \"mode\": \"line\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->textDiff([\n    'a' => 'one\ntwo\nthree',\n    'b' => 'one\n2\nthree',\n    'mode' => 'line',\n]);\necho $result->requestId;"}]}},"/v1/documents/web-to-markdown":{"post":{"operationId":"documents.web-to-markdown","summary":"Web page to Markdown","description":"Turn a web page into clean Markdown: the main article with its headings, lists, tables, code blocks and links, without menus, ads and scripts. Give a web address or the page source.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"example":"https://example.com/blog/my-post","description":"The web address of the page, starting with https:// or http://. Use this or html.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Neither url nor html -> 400 missing_field; both -> 400. A private, local or blocked address, a host not on the server's allowed list, or URL input switched off for the plan -> 400 / 403. A page that is not HTML (a PDF, an image) -> 415. The page is fetched by the same guarded downloader as every URL input: public http(s) addresses only, redirects re-checked, 5 MB at most.","evidence":"src/processing/web/web-markdown.js"}},"html":{"type":"string","maxLength":5000000,"description":"The page source as text, instead of a web address. Handy when you already have the HTML (for example from an earlier step).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/web-markdown.js"}},"main_only":{"type":"boolean","default":true,"description":"true (default): keep only the main article and drop menus, headers, footers, sidebars and ads, like a browser's reader view. false: convert the whole page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/web-markdown.js"}},"selector":{"type":"string","example":"article.post","description":"A CSS selector that picks the part of the page to convert, for example article.post or #content. It replaces main_only.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a valid selector, or one that matches nothing -> 400.","evidence":"src/processing/web/web-markdown.js"}},"include_links":{"type":"boolean","default":true,"description":"true (default): keep links as Markdown links with full addresses. false: keep only the link text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/web-markdown.js"}},"include_images":{"type":"boolean","default":false,"description":"true: keep pictures as Markdown images with their full address. false (default): leave them out.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/web-markdown.js"}},"front_matter":{"type":"boolean","default":false,"description":"true: start the Markdown with a small header block (title, source, author, date, description) between --- lines, as static-site tools expect.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/web-markdown.js"}},"base_url":{"type":"string","example":"https://example.com/blog/","description":"With html: the address the page came from, so relative links and pictures become full addresses.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/web-markdown.js"}},"max_chars":{"type":"integer","minimum":0,"maximum":2000000,"default":0,"description":"Cut the Markdown after this many characters (0 = no cut, the default). The answer says truncated when it was cut.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/web/web-markdown.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format: \"md\", markdown, title, description, author, published, site, language, canonical, words, characters, source?, truncated?, warnings? }. `url` is the .md file; `markdown` is the same text inline.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string"},"markdown":{"type":"string","description":"The page as Markdown (the same text as the file)."},"title":{"type":"string"},"description":{"type":"string"},"author":{"type":"string"},"published":{"type":"string"},"site":{"type":"string"},"language":{"type":"string"},"canonical":{"type":"string"},"words":{"type":"integer"},"characters":{"type":"integer"},"source":{"type":"string","description":"The address the page was fetched from, after redirects (url only)."},"truncated":{"type":"boolean","description":"true when max_chars cut the Markdown."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","markdown","words","characters"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"documents.web-to-markdown","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/web-to-markdown\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'url=https://example.com/blog/my-post' \\\n  -F 'selector=article.post' \\\n  -F 'base_url=https://example.com/blog/'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.webToMarkdown({\n    \"url\": \"https://example.com/blog/my-post\",\n    \"selector\": \"article.post\",\n    \"base_url\": \"https://example.com/blog/\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->webToMarkdown([\n    'url' => 'https://example.com/blog/my-post',\n    'selector' => 'article.post',\n    'base_url' => 'https://example.com/blog/',\n]);\necho $result->requestId;"}]}},"/v1/documents/word-count":{"post":{"operationId":"documents.word-count","summary":"Word counter and readability","description":"Count the characters, words, sentences and paragraphs of a text or a document, time its reading and speaking, score how easy it is to read (Flesch, Fog, SMOG and more; German, Spanish and French formulas), list the most used words and phrases and the longest sentences, and check it against a word or character limit.","tags":["Documents"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"A document whose text is counted (Word, PDF, Markdown, HTML, text ...). Send this or the text field.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"text":{"type":"string","example":"The quick brown fox jumps over the lazy dog.","description":"The text to count (instead of a file; up to 20 million characters). HTML and Markdown marks are ignored unless strip_markup is false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/documents-word-count.js"}},"language":{"type":"string","enum":["en","de","es","fr"],"default":"en","description":"en (default), de, es or fr: the readability formula and the common words to leave out.","x-davix-h2i-enum":"DocumentsWordCountLanguage","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"reading_wpm":{"type":"integer","minimum":50,"maximum":1000,"default":238,"description":"Reading speed in words per minute, 50 to 1000 (default 238).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"speaking_wpm":{"type":"integer","minimum":50,"maximum":400,"default":150,"description":"Speaking speed in words per minute, 50 to 400 (default 150).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"readability":{"type":"boolean","default":true,"description":"true (default): score how easy the text is to read.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"top":{"type":"integer","minimum":0,"maximum":100,"default":10,"description":"How many of the most used words or phrases to list, 0 to 100 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"min_word_length":{"type":"integer","minimum":1,"maximum":20,"default":3,"description":"Leave words shorter than this out of the list, 1 to 20 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"phrase_length":{"type":"integer","minimum":1,"maximum":3,"default":1,"description":"Count single words (1, default) or phrases of 2 or 3 words.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"ignore_common_words":{"type":"boolean","default":true,"description":"true (default): leave common words (the, and, of ...) out of the list.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"case_sensitive":{"type":"boolean","default":false,"description":"true: Apple and apple are different words. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"include_numbers":{"type":"boolean","default":false,"description":"true: numbers count as words. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"strip_markup":{"type":"boolean","default":true,"description":"true (default): ignore HTML tags and Markdown marks in the text field.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"longest_sentences":{"type":"integer","minimum":0,"maximum":20,"default":3,"description":"How many of the longest sentences to return, 0 to 20 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"long_sentence_words":{"type":"integer","minimum":10,"maximum":100,"default":25,"description":"A sentence with more words than this is called long in the hints, 10 to 100 (default 25).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"min_words":{"type":"integer","minimum":0,"maximum":100000000,"description":"Check that the text has at least this many words.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"max_words":{"type":"integer","minimum":0,"maximum":100000000,"description":"Check that the text has at most this many words.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"max_characters":{"type":"integer","minimum":0,"maximum":1000000000,"description":"Check that the text has at most this many characters.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/documents/word-count.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ counts: { characters, charactersNoSpaces, words, sentences, paragraphs, lines, uniqueWords, syllables }, stats, time: { readingMinutes, speakingMinutes, readingSeconds, speakingSeconds }, readability?, keywords: [{ word, count, percent }], longestSentences: [{ sentence, words, position }], hints, checks?, withinLimits?, source: { kind, format?, pages? }, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","description":"characters, charactersNoSpaces, words, sentences, paragraphs, lines, uniqueWords and syllables."},"stats":{"type":"object","description":"averageWordLength, averageSentenceLength, averageSyllablesPerWord, longestWord and lexicalDiversity."},"time":{"type":"object","description":"readingMinutes, speakingMinutes, readingSeconds and speakingSeconds."},"readability":{"type":"object","description":"formula, fleschReadingEase, fleschKincaidGrade, gunningFog, smog, colemanLiau, automatedReadability, averageGrade and level."},"keywords":{"type":"array","items":{"type":"object"},"description":"The most used words or phrases: word, count and percent."},"longestSentences":{"type":"array","items":{"type":"object"},"description":"The longest sentences: sentence, words and position."},"hints":{"type":"array","items":{"type":"string"},"description":"Short tips, for example about long sentences."},"checks":{"type":"object","description":"minWords, maxWords and maxCharacters: limit, ok and how many words or characters are missing or over."},"withinLimits":{"type":"boolean","description":"true when every limit you gave is kept."},"source":{"type":"object","description":"kind (text or file), and for a file its format and pages."},"warnings":{"type":"array","items":{"type":"string"},"description":"Notes from reading the file."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["counts","stats","time","keywords","longestSentences","hints","source"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"documents.word-count","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"documents","rateLimitCategory":"documents","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/documents/word-count\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text=The quick brown fox jumps over the lazy dog.' \\\n  -F 'language=en' \\\n  -F 'reading_wpm=238'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.documents.wordCount({\n    \"text\": \"The quick brown fox jumps over the lazy dog.\",\n    \"language\": \"en\",\n    \"reading_wpm\": 238\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->documents()->wordCount([\n    'text' => 'The quick brown fox jumps over the lazy dog.',\n    'language' => 'en',\n    'reading_wpm' => 238,\n]);\necho $result->requestId;"}]}},"/v1/email/preferences":{"get":{"operationId":"email.preferences","summary":"Which emails you receive","description":"Which emails you receive","tags":["Notifications"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"news":{"type":"object","description":"enabled: whether you get news."},"items":{"type":"array","items":{"type":"object"},"description":"One per email you may turn off: id, label, hint, section, section_label, enabled."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["news","items"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"email.preferences","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/email/preferences\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.email.getPreferences();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->email()->getPreferences();\necho $result->requestId;"}]},"put":{"operationId":"email.preferences.put","summary":"Switch your emails on or off","description":"Switch your emails on or off","tags":["Notifications"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"news":{"type":"boolean","description":"News and campaigns: true = send, false = stop.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown email or a value that is not true or false -> 400 invalid_parameter.","evidence":"src/api/email/routes.js"}},"items":{"type":"object","description":"Automatic emails by their id: { \"<id>\": true or false }.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown email or a value that is not true or false -> 400 invalid_parameter.","evidence":"src/api/email/routes.js"}}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"news":{"type":"object","description":"enabled: whether you get news."},"items":{"type":"array","items":{"type":"object"},"description":"One per email you may turn off: id, label, hint, section, section_label, enabled."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["news","items"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired"],"x-davix-h2i-id":"email.preferences.put","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X PUT \"$DAVIX_H2I_URL/v1/email/preferences\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"news\":true,\"items\":{}}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.email.updatePreferences({\n    \"news\": true,\n    \"items\": {}\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->email()->updatePreferences([\n    'news' => true,\n    'items' => [\n\n    ],\n]);\necho $result->requestId;"}]}},"/v1/files":{"get":{"operationId":"files","summary":"The authenticated customer's processed-file history. Advanced server-side filtering + pagination added in the Dashboard History pass (2026-09-28).","description":"The authenticated customer's processed-file history. Advanced server-side filtering + pagination added in the Dashboard History pass (2026-09-28).","tags":["Files"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"max(1, parseInt(page) || 1).","evidence":"src/api/files/list.js"}},"description":"1-based page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [1,200]; non-numeric -> 50.","evidence":"src/api/files/list.js"}},"description":"Page size."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["available","expired","all"],"default":"available","x-davix-h2i-enum":"FilesStatus","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/files/list.js"}},"description":"File availability."},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["image","pdf","render","other"],"x-davix-h2i-enum":"FilesCategory","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/files/list.js"}},"description":"Filter by category."},{"name":"operation","in":"query","required":false,"schema":{"type":"string","maxLength":191,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","note":"Trimmed and truncated to 191 characters.","evidence":"src/api/files/list.js"}},"description":"Filter by operation name."},{"name":"app","in":"query","required":false,"schema":{"type":"string","maxLength":60,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","note":"Cleaned like the `app` field; blank = no filter.","evidence":"src/api/files/list.js"}},"description":"Only files made by this app (the name as shown in the History, for example \"Davix H2I plugin\"). `filters.apps` in the answer lists the apps that made your files."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/files/list.js"}},"description":"Only files created at or after this date."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/files/list.js"}},"description":"Only files created at or before this date."},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":191,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","note":"Trimmed and truncated to 191 characters; blank = no search.","evidence":"src/api/files/list.js"}},"description":"Text search in the file name, the operation and the app."},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["created_at_desc","created_at_asc","size_desc","size_asc"],"default":"created_at_desc","x-davix-h2i-enum":"FilesSort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/files/list.js"}},"description":"Sort order."},{"name":"job_id","in":"query","required":false,"schema":{"type":"integer","minimum":1,"x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a positive integer -> 400 invalid_parameter.","evidence":"src/api/files/list.js"}},"description":"Only the files produced by this async job (the job_id of the 202 answer, also listed by GET /v1/jobs)."}],"responses":{"200":{"description":"Paginated file list.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/StoredFile"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"},"filters":{"type":"object","properties":{"operations":{"type":"array","items":{"type":"string"}},"categories":{"type":"array","items":{"type":"string"}},"apps":{"type":"array","items":{"type":"string"}}},"required":["operations","categories","apps"]},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","page","limit","total","has_more","filters"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired"],"x-davix-h2i-id":"files","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/files?page=1&limit=50&status=available\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.files.list({\n    \"page\": 1,\n    \"limit\": 50,\n    \"status\": \"available\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->files()->list([\n    'page' => 1,\n    'limit' => 50,\n    'status' => 'available',\n]);\necho $result->requestId;"}]}},"/v1/files/{id}":{"delete":{"operationId":"files._id_.delete","summary":"Delete one of the customer's processed files","description":"Deletes the file now instead of waiting for the plan's retention window: the history entry and the file on disk go, and the download link stops working at once. Only the customer's own files; anything else is 404 not_found.","tags":["Files"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"File id (from GET /v1/files)."}],"responses":{"200":{"description":"Paginated file list.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"id":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["deleted","id"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"files.{id}.delete","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X DELETE \"$DAVIX_H2I_URL/v1/files/1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.files.delete({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->files()->delete([\n    'id' => 1,\n]);\necho $result->requestId;"}]},"get":{"operationId":"files._id_","summary":"One of the customer's processed files","description":"A single processed file with a fresh signed download link while it is available (individual customer keys). Someone else's file, or an unknown id, is 404 not_found.","tags":["Files"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"File id (from GET /v1/files)."}],"responses":{"200":{"description":"Paginated file list.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/StoredFile"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["file"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"files.{id}","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/files/1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.files.get({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->files()->get([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/files/fetch-url":{"post":{"operationId":"files.fetch-url","summary":"Fetch a public web address and return the file","description":"Downloads one public web address and returns the file (name, type, size and its bytes as base64). Studio uses it to show the preview and the tags of a file you pasted an address for. It follows exactly what URL input follows on the operation you name: the server switch, the allowed hosts, public http(s) addresses only (redirects re-checked) and your plan's controls for that operation (URL input allowed, largest download). Nothing is stored and nothing is counted as a processed file.","tags":["Files"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"The public http(s) address of the file.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) address, credentials in the address, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed.","evidence":"src/platform/uploads/url-ingest.js"}},"operation":{"type":"string","description":"The id of the operation the file is for (for example images.metadata). The plan's URL-input controls of that operation apply.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An operation that does not accept web addresses -> 400 invalid_parameter.","evidence":"src/api/files/fetch-url.js"}}},"required":["url","operation"]}}}},"responses":{"200":{"description":"The fetched file.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer"},"data":{"type":"string","description":"The file, base64-encoded."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["name","contentType","sizeBytes","data"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","format_not_allowed","internal_error","invalid_api_key","invalid_parameter","key_expired","url_blocked","url_fetch_failed"],"x-davix-h2i-id":"files.fetch-url","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/files/fetch-url\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\":\"example\",\"operation\":\"example\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.files.fetchUrl({\n    \"url\": \"example\",\n    \"operation\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->files()->fetchUrl([\n    'url' => 'example',\n    'operation' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/formats":{"get":{"operationId":"formats","summary":"The file formats the API reads and writes, and which endpoint takes each","description":"Every format Davix H2I knows (images, documents, data): its MIME types and extensions, what it can do (read, write, animated, alpha, ...), which endpoints accept it as an upload (`accepted_by`) or produce it as a result (`produced_by`), whether the tool behind it is installed on this server (`available`), and whether the calling key's plan allows it (`allowed`). The same list validates uploads, fills the accepted-format lists in the contract and OpenAPI, and populates Studio's format pickers, so read it here instead of hard-coding formats. Only supported formats are listed unless `status` asks for more.","tags":["Meta"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"family","in":"query","required":false,"schema":{"type":"string","enum":["image","document","data"],"x-davix-h2i-enum":"MetaFamily","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/formats/get.js"}},"description":"Only formats of this family."},{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["input","output"],"x-davix-h2i-enum":"MetaDirection","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/formats/get.js"}},"description":"input = formats the API can read; output = formats it can write."},{"name":"endpoint","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An endpoint that declares no formats -> 404 not_found.","evidence":"src/api/formats/get.js"}},"description":"Only the formats this endpoint (its id, such as images.resize, or its path) accepts or produces."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["supported","planned","all"],"default":"supported","x-davix-h2i-enum":"MetaStatus","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/formats/get.js"}},"description":"supported (default) lists what works today; planned lists formats that are recognised but not yet accepted; all lists both."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer"},"formats":{"type":"array","items":{"$ref":"#/components/schemas/FormatInfo"}},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"core":{"type":"boolean"},"policy_meter":{"type":"string"}},"required":["id","label","core"]}},"sets":{"type":"object","additionalProperties":true,"description":"Named format sets (for example image.input, image.output) -> format ids."},"tools":{"type":"object","additionalProperties":true,"description":"Optional tools behind some formats -> { available, version }."},"ocr":{"type":"object","properties":{"languages":{"type":"array","items":{"type":"string"}}},"required":["languages"],"description":"OCR languages installed on this server."},"fonts":{"type":"object","additionalProperties":true,"description":"Installed font families and which writing systems this server can draw (every probed script, CJK and emoji are covered when listed as supported)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["version","formats","groups","sets","tools","ocr","fonts"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","internal_error","invalid_api_key","invalid_parameter","key_expired","not_found"],"x-davix-h2i-id":"formats","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/formats?family=image&direction=input&status=supported\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.formats.list({\n    \"family\": \"image\",\n    \"direction\": \"input\",\n    \"status\": \"supported\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->formats()->list([\n    'family' => 'image',\n    'direction' => 'input',\n    'status' => 'supported',\n]);\necho $result->requestId;"}]}},"/v1/images/animate":{"post":{"operationId":"images.animate","summary":"Build an animated GIF from still frames","description":"Build an animated GIF from still frames","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":2,"maxItems":60,"description":"2-60 frames; upload order is frame order.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"delayMs":{"type":"integer","minimum":10,"maximum":60000,"default":100,"description":"Frame delay (ms). Either one number for all frames, or a JSON array with exactly one entry per frame.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of milliseconds from 10 to 60000, or an array with one such number per frame; anything else -> 400 invalid_parameter. An array whose length differs from the number of frames -> 400.","evidence":"src/processing/images/engine.js:applyAnimate; src/shared/param-validation.js"}},"loopCount":{"type":"integer","minimum":0,"default":0,"description":"Loop count (0 = forever).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Negative -> 0; non-numeric -> 0.","evidence":"src/processing/images/engine.js:applyAnimate"}},"format":{"type":"string","enum":["gif"],"default":"gif","description":"Only gif is supported.","x-davix-h2i-enum":"ImagesAnimateFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:applyAnimate"}},"colorDepth":{"type":"integer","minimum":2,"maximum":8,"default":8,"description":"Palette bit depth (2^n colors).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number from 2 to 8; anything else -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyAnimate; src/shared/param-validation.js"}},"frameOrder":{"type":"array","maxItems":60,"items":{"type":"integer","minimum":0},"description":"Explicit 0-based frame indices (JSON array). Takes precedence over keepEveryNthFrame/reverse.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Index out of range, empty array or > 60 entries -> 400.","evidence":"src/processing/images/engine.js:applyFrameSelection"}},"keepEveryNthFrame":{"type":"integer","minimum":1,"description":"Keep every Nth frame (maximum = number of uploaded frames).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1, frame count] -> 400. Fewer than 2 resulting frames -> 400.","evidence":"src/processing/images/engine.js:applyFrameSelection"},"x-davix-h2i-depends-on":[{"field":"frameOrder","present":false}]},"reverse":{"type":"boolean","description":"Reverse the frame order (applied after keepEveryNthFrame).","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:applyFrameSelection"},"x-davix-h2i-depends-on":[{"field":"frameOrder","present":false}]},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"frameOrder":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"frameCount":{"type":"integer"},"delayMs":{"type":"integer"},"loopCount":{"type":"integer"},"colorDepth":{"type":"integer"}},"required":["url","format","sizeBytes","width","height","frameCount","delayMs","loopCount","colorDepth"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"images","minFiles":2,"ceiling":60,"directFiles":60,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"images.animate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/animate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'delayMs=100' \\\n  -F 'loopCount=0' \\\n  -F 'format=gif'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.animate({\n    \"images\": 'photo.jpg',\n    \"delayMs\": 100,\n    \"loopCount\": 0,\n    \"format\": \"gif\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->animate([\n    'images' => 'photo.jpg',\n    'delayMs' => 100,\n    'loopCount' => 0,\n    'format' => 'gif',\n]);\necho $result->requestId;"}]}},"/v1/images/auto-optimize":{"post":{"operationId":"images.auto-optimize","summary":"Automatically select the best format/quality","description":"Automatically select the best format/quality","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s). The server picks the best output format/quality per image.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"maxSizeKB":{"type":"integer","minimum":1,"description":"Desired maximum size (KB). The decision object in the response records whether it was met.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Non-integer or < 1 -> 400.","evidence":"src/processing/images/engine.js:applyAutoOptimize"}},"colorSpace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Output color space.","x-davix-h2i-enum":"ColorSpace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"One of srgb, grayscale, cmyk. Any other value -> 400 invalid_parameter. cmyk on a build without CMYK support -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyOptimize (verified by running the engine)"}},"keepMetadata":{"type":"boolean","description":"Keep EXIF/ICC metadata.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:applyAutoOptimize"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ImageResult"}],"type":"object","properties":{"quality":{"type":"integer","nullable":true},"decision":{"type":"object","properties":{"originalFormat":{"type":"string","nullable":true},"originalSizeBytes":{"type":"integer"},"selectedFormat":{"type":"string"},"selectedQuality":{"type":"integer","nullable":true},"selectedSizeBytes":{"type":"integer"},"percentSaved":{"type":"number","nullable":true},"candidatesEvaluated":{"type":"array","items":{"type":"object"},"description":"Every format/quality candidate that was tried: {format, quality, sizeBytes}."},"maxSizeKB":{"type":"number","nullable":true},"metConstraint":{"type":"boolean"},"isAnimated":{"type":"boolean"},"hasAlpha":{"type":"boolean"}},"required":["originalSizeBytes","selectedFormat","selectedSizeBytes"]}},"required":["decision"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.auto-optimize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/auto-optimize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'maxSizeKB=1' \\\n  -F 'colorSpace=srgb' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.autoOptimize({\n    \"images\": 'photo.jpg',\n    \"maxSizeKB\": 1,\n    \"colorSpace\": \"srgb\",\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->autoOptimize([\n    'images' => 'photo.jpg',\n    'maxSizeKB' => 1,\n    'colorSpace' => 'srgb',\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/images/avatar":{"post":{"operationId":"images.avatar","summary":"Avatar maker","description":"A profile picture from a name or any seed: initials on a colour, an identicon pattern, a gradient or a pixel pattern. The same seed always gives the same picture.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Ada Lovelace","description":"The name to take the initials from (up to 200 characters). Needed unless seed is given.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"},"x-davix-h2i-required-when":[{"field":"seed","present":false}]},"seed":{"type":"string","example":"user-4711","description":"Any text that decides the colours and the pattern (default: the name). The same seed gives the same picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"style":{"type":"string","enum":["initials","identicon","gradient","pixel"],"default":"initials","description":"initials (default), identicon, gradient or pixel.","x-davix-h2i-enum":"ImagesAvatarStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"shape":{"type":"string","enum":["square","rounded","circle"],"default":"circle","description":"circle (default), rounded or square.","x-davix-h2i-enum":"ImagesAvatarShape","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"size":{"type":"integer","minimum":16,"maximum":2048,"default":256,"description":"Width and height in pixels, 16 to 2048 (default 256).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"file_type":{"type":"string","enum":["png","jpeg","webp","avif","svg"],"default":"png","description":"png (default), jpeg, webp, avif or svg.","x-davix-h2i-enum":"ImagesPictureFileType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"background":{"type":"string","format":"color","default":"auto","description":"A hex colour, or auto (default: chosen from the seed). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"background2":{"type":"string","example":"#fbbf24","description":"A second colour: the end of a gradient, the pattern colour of an identicon or pixel avatar.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"color":{"type":"string","format":"color","example":"#ffffff","description":"The colour of the letters (default: white or dark, whichever reads on the background). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"initials":{"type":"integer","minimum":1,"maximum":3,"default":2,"description":"How many letters, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"uppercase":{"type":"boolean","default":true,"description":"true (default): capital letters.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"bold":{"type":"boolean","default":true,"description":"true (default): bold letters.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"grid":{"type":"integer","minimum":3,"maximum":9,"default":5,"description":"The number of blocks per side of an identicon or pixel avatar, 3 to 9 (default 5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"border":{"type":"number","minimum":0,"maximum":40,"default":0,"description":"A border width in pixels, 0 to 40 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"border_color":{"type":"string","format":"color","default":"#ffffff","description":"The colour of the border (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"default":90,"description":"Quality of jpeg, webp and avif, 1 to 100 (default 90).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/avatar.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, style, background, initials? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["png","jpeg","webp","avif","svg"]},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"style":{"type":"string","enum":["initials","identicon","gradient","pixel"]},"background":{"type":"string","description":"The background colour that was used (hex)."},"initials":{"type":"string","description":"The letters shown, for the initials and gradient styles."}},"required":["url","format","sizeBytes","width","height","style","background"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"images.avatar","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/avatar\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'name=Ada Lovelace' \\\n  -F 'seed=user-4711' \\\n  -F 'style=initials'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.avatar({\n    \"name\": \"Ada Lovelace\",\n    \"seed\": \"user-4711\",\n    \"style\": \"initials\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->avatar([\n    'name' => 'Ada Lovelace',\n    'seed' => 'user-4711',\n    'style' => 'initials',\n]);\necho $result->requestId;"}]}},"/v1/images/barcode":{"post":{"operationId":"images.barcode","summary":"Generate a barcode","description":"A barcode as PNG, SVG or PDF. Symbologies: code128 (Code 128: any ASCII text); code39 (Code 39: A-Z 0-9 - . $ / + % space); ean13 (EAN-13: 12 digits (the check digit is added) or 13); ean8 (EAN-8: 7 digits (the check digit is added) or 8); upca (UPC-A: 11 digits (the check digit is added) or 12); itf (Interleaved 2 of 5: an even number of digits); codabar (Codabar: digits and - $ : / . + between start/stop letters A-D); datamatrix (Data Matrix: any text); pdf417 (PDF417: any text); aztec (Aztec: any text); qrcode (QR Code (barcode renderer): any text). Each one is proven by generating it and reading it back. Counts as one file.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"symbology":{"type":"string","enum":["code128","code39","ean13","ean8","upca","itf","codabar","datamatrix","pdf417","aztec","qrcode"],"description":"The barcode type: code128 (Code 128: any ASCII text); code39 (Code 39: A-Z 0-9 - . $ / + % space); ean13 (EAN-13: 12 digits (the check digit is added) or 13); ean8 (EAN-8: 7 digits (the check digit is added) or 8); upca (UPC-A: 11 digits (the check digit is added) or 12); itf (Interleaved 2 of 5: an even number of digits); codabar (Codabar: digits and - $ : / . + between start/stop letters A-D); datamatrix (Data Matrix: any text); pdf417 (PDF417: any text); aztec (Aztec: any text); qrcode (QR Code (barcode renderer): any text).","x-davix-h2i-enum":"ImagesSymbology","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"text":{"type":"string","maxLength":2000,"description":"What the barcode holds. Each symbology accepts different characters (see symbology); a refusal says what is expected. EAN / UPC check digits are added when you send one digit fewer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"file_type":{"type":"string","enum":["png","svg","pdf"],"default":"png","description":"png (default), svg or pdf.","x-davix-h2i-enum":"ImagesFileType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"color":{"type":"string","format":"color","default":"#000000","description":"Foreground colour, e.g. #000000 (default). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"Background colour, e.g. #ffffff (default). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"scale":{"type":"integer","minimum":1,"maximum":10,"default":3,"description":"Size of one module in pixels: 1 to 10, default 3 (PDF uses at least 6).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"height":{"type":"integer","minimum":3,"maximum":200,"default":10,"description":"Bar height in millimetres for linear codes and the row height of PDF417: 3 to 200, default 10. Square codes (Data Matrix, Aztec, QR) keep their shape.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"include_text":{"type":"boolean","default":false,"description":"Print the human readable text under linear codes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"padding":{"type":"integer","minimum":0,"maximum":100,"default":10,"description":"Quiet zone around the code in pixels: 0 to 100, default 10.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"rotate":{"type":"string","enum":["N","R","L","I"],"default":"N","description":"N (default), R (90 degrees), L (270) or I (180).","x-davix-h2i-enum":"ImagesRotate","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["symbology","text"]}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, symbology }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["png","svg","pdf"]},"sizeBytes":{"type":"integer"},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"symbology":{"type":"string"}},"required":["url","format","sizeBytes","symbology"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"images.barcode","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/barcode\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'symbology=code128' \\\n  -F 'text=example' \\\n  -F 'file_type=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.barcode({\n    \"symbology\": \"code128\",\n    \"text\": \"example\",\n    \"file_type\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->barcode([\n    'symbology' => 'code128',\n    'text' => 'example',\n    'file_type' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/images/beautify":{"post":{"operationId":"images.beautify","summary":"Screenshot beautifier","description":"Put a screenshot on a gradient, a flat colour or a transparent canvas with space around it, rounded corners, a soft shadow and an optional window frame (macOS, Windows or browser bar with a title), cut to a ratio for social posts and slides.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The screenshot(s) to beautify.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"canvas":{"type":"string","format":"color","default":"ocean","example":"#ff7e5f,#feb47b","description":"The canvas: a preset (sunset, ocean, forest, candy, midnight, aurora, lavender, peach, mono, dark), one hex colour, two hex colours separated by a comma (a gradient), or transparent. Default ocean. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"gradient_angle":{"type":"number","minimum":0,"maximum":360,"default":135,"description":"The direction of the gradient in degrees, 0 to 360 (default 135).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"padding":{"type":"integer","minimum":0,"maximum":400,"default":64,"description":"The space around the screenshot in pixels, 0 to 400 (default 64).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"radius":{"type":"integer","minimum":0,"maximum":200,"default":14,"description":"The corner radius of the window in pixels, 0 to 200 (default 14).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"shadow":{"type":"number","minimum":0,"maximum":100,"default":45,"description":"The strength of the shadow, 0 (none) to 100 (default 45).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"frame":{"type":"string","enum":["none","macos","windows","browser"],"default":"none","description":"A window bar above the screenshot: none (default), macos, windows or browser.","x-davix-h2i-enum":"ImagesBeautifyFrame","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"theme":{"type":"string","enum":["light","dark"],"default":"light","description":"The colours of the window bar: light (default) or dark.","x-davix-h2i-enum":"Theme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"title":{"type":"string","example":"example.com","description":"The text in the window bar (up to 80 characters; a page address for the browser frame).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"aspect":{"type":"string","default":"auto","example":"16:9","description":"Grow the canvas to a ratio: auto (default) or 1:1, 4:3, 3:2, 16:9, 16:10, 9:16, 4:5, 1.91:1.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"max_width":{"type":"integer","minimum":200,"maximum":4000,"description":"Scale the screenshot down to this width before framing it, 200 to 4000 (default: as is).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/beautify.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, windowWidth, windowHeight, canvasWidth, canvasHeight, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"windowWidth":{"type":"integer","description":"The framed screenshot width."},"windowHeight":{"type":"integer"},"canvasWidth":{"type":"integer"},"canvasHeight":{"type":"integer"}},"required":["url","format","sizeBytes","width","height","windowWidth","windowHeight","canvasWidth","canvasHeight"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.beautify","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/beautify\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'canvas=#ff7e5f,#feb47b' \\\n  -F 'gradient_angle=135' \\\n  -F 'padding=64'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.beautify({\n    \"images\": 'photo.jpg',\n    \"canvas\": \"#ff7e5f,#feb47b\",\n    \"gradient_angle\": 135,\n    \"padding\": 64\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->beautify([\n    'images' => 'photo.jpg',\n    'canvas' => '#ff7e5f,#feb47b',\n    'gradient_angle' => 135,\n    'padding' => 64,\n]);\necho $result->requestId;"}]}},"/v1/images/blur-background":{"post":{"operationId":"images.blur-background","summary":"Blur background","description":"Keep the subject of a picture sharp and blur the rest, like a portrait-mode photo: the subject is found by cutting away the plain background, or you give the shape of the sharp area (ellipse, rectangle, or a band for a tilt-shift look). Set the blur, the softness of the edge, a dimmed or grey background and a vignette.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to blur the background of.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"focus":{"type":"string","enum":["auto","ellipse","rectangle","band-horizontal","band-vertical"],"default":"auto","description":"auto (default: the subject is cut from a plain background), ellipse, rectangle, band-horizontal or band-vertical.","x-davix-h2i-enum":"ImagesFocus","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"strength":{"type":"number","minimum":1,"maximum":100,"default":12,"description":"How strong the blur is, 1 to 100 (default 12).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"center_x":{"type":"number","minimum":0,"maximum":100,"default":50,"description":"The centre of the sharp area in percent of the width, 0 to 100 (default 50).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"center_y":{"type":"number","minimum":0,"maximum":100,"default":50,"description":"The centre in percent of the height, 0 to 100 (default 50).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"focus_width":{"type":"number","minimum":5,"maximum":100,"default":50,"description":"The width of the sharp area in percent, 5 to 100 (default 50).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"focus_height":{"type":"number","minimum":5,"maximum":100,"default":60,"description":"The height of the sharp area in percent, 5 to 100 (default 60).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"feather":{"type":"number","minimum":0,"maximum":100,"default":15,"description":"How soft the edge of the sharp area is, 0 to 100 (default 15).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"tolerance":{"type":"number","minimum":0,"maximum":100,"default":30,"description":"auto: how different from the background a colour must be to be the subject, 0 to 100 (default 30).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"invert":{"type":"boolean","default":false,"description":"true: blur the subject and keep the surroundings sharp. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"darken":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"Dim the blurred background, 0 to 1 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"desaturate":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"Remove colour from the blurred background, 0 to 1 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"vignette":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"Darken the corners, 0 to 1 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"show_mask":{"type":"boolean","default":false,"description":"true: return the mask (white = sharp) instead of the picture. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"max_width":{"type":"integer","minimum":100,"maximum":6000,"description":"Scale the picture down to this width first, 100 to 6000 (default: as is).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-background.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, focus, strength?, mask?, subjectShare?, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"focus":{"type":"string"},"strength":{"type":"number"},"mask":{"type":"boolean","description":"true when the picture is the mask (show_mask)."},"subjectShare":{"type":"number","description":"auto: the share of the picture that was found to be the subject (0 to 1)."}},"required":["url","format","sizeBytes","width","height","focus"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.blur-background","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/blur-background\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'focus=auto' \\\n  -F 'strength=12' \\\n  -F 'center_x=50'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.blurBackground({\n    \"images\": 'photo.jpg',\n    \"focus\": \"auto\",\n    \"strength\": 12,\n    \"center_x\": 50\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->blurBackground([\n    'images' => 'photo.jpg',\n    'focus' => 'auto',\n    'strength' => 12,\n    'center_x' => 50,\n]);\necho $result->requestId;"}]}},"/v1/images/blur-regions":{"post":{"operationId":"images.blur-regions","summary":"Blur regions","description":"Hide parts of a picture (faces, number plates, names on a screenshot) by blurring, pixelating or covering the rectangles and ellipses you give, in pixels or in percent.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s). The picture is turned upright first, so coordinates are those of the picture as it is seen.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"regions":{"type":"array","example":"[{\"x\":40,\"y\":30,\"width\":120,\"height\":80,\"shape\":\"ellipse\"}]","items":{"type":"object","properties":{"x":{"type":"number","description":"Left edge (px or percent)."},"y":{"type":"number","description":"Top edge (px or percent)."},"width":{"type":"number","description":"Width (px or percent)."},"height":{"type":"number","description":"Height (px or percent)."},"shape":{"type":"string","enum":["rectangle","ellipse"],"description":"rectangle (default) or ellipse.","x-davix-h2i-enum":"ImagesBlurRegionsShape"},"mode":{"type":"string","enum":["blur","pixelate","cover"],"description":"How this area is hidden.","x-davix-h2i-enum":"ImagesBlurRegionsMode"},"strength":{"type":"number","minimum":1,"maximum":100,"description":"Blur or pixel size, 1 to 100."}}},"description":"The areas to hide, a JSON list of { x, y, width, height, shape?, mode?, strength? }. shape is rectangle (default) or ellipse; mode and strength can differ per area. Up to 100.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Missing -> 400 missing_field; an area with no size, or every area outside the picture -> 400.","evidence":"src/processing/images/blur-regions.js"}},"unit":{"type":"string","enum":["px","percent"],"default":"px","description":"px (default) or percent: whether x, y, width and height are pixels or percent of the picture.","x-davix-h2i-enum":"ImagesBlurRegionsUnit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-regions.js"}},"mode":{"type":"string","enum":["blur","pixelate","cover"],"default":"blur","description":"What to do in the areas: blur (default), pixelate or cover (a flat colour that hides everything).","x-davix-h2i-enum":"ImagesBlurRegionsMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-regions.js"}},"strength":{"type":"number","minimum":1,"maximum":100,"default":20,"description":"How strong the blur or pixelation is, 1 to 100 (default 20). A face needs 30 or more to be unreadable.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-regions.js"}},"fill":{"type":"string","format":"color","default":"#000000","description":"The colour of mode=cover as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-regions.js"}},"padding":{"type":"number","minimum":0,"maximum":200,"default":0,"description":"Grow every area by this many pixels on each side (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/blur-regions.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images","regions"]},"encoding":{"regions":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, originalName, regionsApplied, regionsOutside?, warnings? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"regionsApplied":{"type":"integer"},"regionsOutside":{"type":"array","items":{"type":"integer"},"description":"The indexes of areas that were outside the picture and skipped."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["url","format","sizeBytes","width","height","regionsApplied"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.blur-regions","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/blur-regions\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'regions=[{\"x\":40,\"y\":30,\"width\":120,\"height\":80,\"shape\":\"ellipse\"}]' \\\n  -F 'unit=px' \\\n  -F 'mode=blur'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.blurRegions({\n    \"images\": 'photo.jpg',\n    \"regions\": \"[{\\\"x\\\":40,\\\"y\\\":30,\\\"width\\\":120,\\\"height\\\":80,\\\"shape\\\":\\\"ellipse\\\"}]\",\n    \"unit\": \"px\",\n    \"mode\": \"blur\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->blurRegions([\n    'images' => 'photo.jpg',\n    'regions' => '[{\"x\":40,\"y\":30,\"width\":120,\"height\":80,\"shape\":\"ellipse\"}]',\n    'unit' => 'px',\n    'mode' => 'blur',\n]);\necho $result->requestId;"}]}},"/v1/images/checkboxes":{"post":{"operationId":"images.checkboxes","summary":"Read checkboxes","description":"Find the checkboxes of a form picture and say which are ticked, with their position, size and how full they are; optionally the picture marked with green (ticked) and red (empty) frames.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The form picture(s): a scan or a photo.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"min_size":{"type":"integer","minimum":6,"maximum":400,"default":12,"description":"The smallest checkbox side, in pixels of the picture (default 12).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/checkboxes.js"}},"max_size":{"type":"integer","minimum":8,"maximum":800,"default":80,"description":"The largest checkbox side, in pixels of the picture (default 80).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/checkboxes.js"}},"threshold":{"type":"integer","minimum":1,"maximum":254,"description":"The grey level (1 to 254) below which a pixel is ink. Not given: found for each picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/checkboxes.js"}},"fill_threshold":{"type":"number","minimum":0.01,"maximum":0.95,"default":0.15,"description":"The share of dark pixels inside a box, 0.01 to 0.95 (default 0.15), from which it counts as ticked.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/checkboxes.js"}},"aspect_tolerance":{"type":"number","minimum":0.02,"maximum":0.6,"default":0.25,"description":"How far from a square a box may be, 0.02 to 0.6 (default 0.25).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/checkboxes.js"}},"inset":{"type":"number","minimum":0.05,"maximum":0.4,"default":0.22,"description":"How much of the box edge to leave out when measuring how full it is, 0.05 to 0.4 of its side (default 0.22).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/checkboxes.js"}},"annotate":{"type":"boolean","default":false,"description":"true: also make the picture with a green frame on ticked boxes and a red one on empty boxes (annotatedUrl). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/checkboxes.js"}},"include_unchecked":{"type":"boolean","default":true,"description":"true (default): list every box. false: list only the ticked ones.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/checkboxes.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ originalName, width, height, count, checked, unchecked, boxes: [{ x, y, width, height, checked, fill, confidence }], annotatedUrl?, annotatedBytes? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"count":{"type":"integer"},"checked":{"type":"integer"},"unchecked":{"type":"integer"},"boxes":{"type":"array","items":{"type":"object"},"description":"Each box: x, y, width, height (pixels of the picture), checked, fill (the share of dark pixels inside, 0 to 1) and confidence (0 to 1)."},"annotatedUrl":{"type":"string","format":"uri","description":"The marked-up picture, when annotate is true."},"annotatedBytes":{"type":"integer"}},"required":["width","height","count","checked","unchecked","boxes"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.checkboxes","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/checkboxes\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'min_size=12' \\\n  -F 'max_size=80' \\\n  -F 'threshold=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.checkboxes({\n    \"images\": 'photo.jpg',\n    \"min_size\": 12,\n    \"max_size\": 80,\n    \"threshold\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->checkboxes([\n    'images' => 'photo.jpg',\n    'min_size' => 12,\n    'max_size' => 80,\n    'threshold' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/codes-bulk":{"post":{"operationId":"images.codes-bulk","summary":"Bulk codes from a sheet","description":"Make one QR code or barcode for every row of a sheet (CSV, TSV, Excel or JSON) and get them all in one ZIP, named from the sheet, with a manifest.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"data_file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The sheet: a CSV, TSV, XLSX, ODS or JSON file. The first row holds the column names. Send the file, or its web address in data_file_url.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Up to 1000 codes per request. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"column":{"type":"string","example":"sku","description":"The column whose values become the codes (default: the first column).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"name_column":{"type":"string","example":"product","description":"The column that names the files (default: the value of the code).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"prefix":{"type":"string","example":"label-","description":"Text put before every file name (up to 40 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"text_prefix":{"type":"string","example":"https://shop.example/p/","description":"Text put before the value inside every code, for example a web address (\"https://shop.example/p/\").","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"symbology":{"type":"string","default":"qr","description":"qr (default) or a barcode type: code128, code39, ean13, ean8, upca, itf, codabar, datamatrix, pdf417, aztec ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"file_type":{"type":"string","enum":["png","svg","pdf"],"default":"png","description":"png (default), svg or pdf.","x-davix-h2i-enum":"ImagesFileType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"size":{"type":"integer","minimum":50,"maximum":4000,"default":600,"description":"QR code size in pixels (default 600).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"margin":{"type":"integer","minimum":0,"maximum":20,"default":4,"description":"Quiet zone: modules around a QR code, pixels around a barcode (default 4).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"error_correction":{"type":"string","enum":["L","M","Q","H"],"description":"QR error correction: L, M, Q or H.","x-davix-h2i-enum":"ImagesErrorCorrection","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"color":{"type":"string","format":"color","example":"#111827","description":"Foreground colour as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"background":{"type":"string","format":"color","example":"#ffffff","description":"Background colour as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"include_text":{"type":"boolean","default":false,"description":"Barcodes: print the value under the bars. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"height":{"type":"number","minimum":3,"maximum":60,"default":12,"description":"Barcode height in mm (default 12).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"scale":{"type":"integer","minimum":1,"maximum":10,"default":3,"description":"Barcode scale, 1 to 10 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"skip_empty":{"type":"boolean","default":true,"description":"true (default): leave out rows with an empty value.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"dedupe":{"type":"boolean","default":true,"description":"true (default): make one code per different value.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"manifest":{"type":"boolean","default":true,"description":"true (default): add manifest.csv (file, value) to the ZIP.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"max":{"type":"integer","minimum":1,"maximum":1000,"default":500,"description":"The most codes to make, 1 to 1000 (default 500).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes-bulk.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"data_file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["data_file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, count, column, skipped, failed, files: [{ name, value, bytes }], warnings? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["zip"]},"sizeBytes":{"type":"integer"},"count":{"type":"integer","description":"How many codes are in the ZIP."},"column":{"type":"string"},"skipped":{"type":"integer","description":"Rows left out (empty or repeated values)."},"failed":{"type":"integer","description":"Values that could not be made into this kind of code."},"files":{"type":"array","items":{"type":"object"},"description":"Every file of the ZIP: name, value and bytes."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["url","format","sizeBytes","count","column","skipped","failed","files"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"data_file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.codes-bulk","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/codes-bulk\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'data_file=@photo.jpg' \\\n  -F 'column=sku' \\\n  -F 'name_column=product' \\\n  -F 'prefix=label-'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.codesBulk({\n    \"data_file\": 'photo.jpg',\n    \"column\": \"sku\",\n    \"name_column\": \"product\",\n    \"prefix\": \"label-\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->codesBulk([\n    'data_file' => 'photo.jpg',\n    'column' => 'sku',\n    'name_column' => 'product',\n    'prefix' => 'label-',\n]);\necho $result->requestId;"}]}},"/v1/images/collage":{"post":{"operationId":"images.collage","summary":"Collage maker","description":"Make one collage from several pictures: a grid, a row, a column, a masonry of columns, a mosaic of rows with equal height, or a pile of tilted photos with white frames, with spacing, borders, rounded corners, a background, shadows, and a shuffle with a seed.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":2,"description":"The pictures for the collage, in the order they appear (at least 2, at most 60).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"layout":{"type":"string","enum":["grid","row","column","masonry","mosaic","polaroid"],"default":"grid","description":"grid, row, column, masonry, mosaic, polaroid (default grid).","x-davix-h2i-enum":"ImagesCollageLayout","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"columns":{"type":"integer","minimum":1,"maximum":12,"description":"grid, masonry, polaroid: how many columns, 1 to 12 (default: from the number of pictures).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"width":{"type":"integer","minimum":200,"maximum":8000,"default":2000,"description":"The width of the collage in pixels, 200 to 8000 (default 2000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"height":{"type":"integer","minimum":200,"maximum":8000,"description":"The height in pixels, 200 to 8000 (default: from the layout).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"cell_ratio":{"type":"number","minimum":0.2,"maximum":5,"default":1,"description":"grid: the width divided by the height of a cell, 0.2 to 5 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"row_height":{"type":"integer","minimum":50,"maximum":2000,"description":"mosaic: the target height of a row in pixels, 50 to 2000.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"spacing":{"type":"number","minimum":0,"maximum":100,"default":8,"description":"The space between pictures in pixels, 0 to 100 (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"margin":{"type":"number","minimum":0,"maximum":200,"default":0,"description":"The space around the collage in pixels, 0 to 200 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"fit":{"type":"string","enum":["cover","contain"],"default":"cover","description":"cover (default: fill the cell and crop) or contain (fit inside).","x-davix-h2i-enum":"Fit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"border":{"type":"number","minimum":0,"maximum":60,"default":0,"description":"A border around each picture in pixels, 0 to 60 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"border_color":{"type":"string","format":"color","default":"#ffffff","example":"#ffffff","description":"The border as a hex colour (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"radius":{"type":"number","minimum":0,"maximum":200,"default":0,"description":"Rounded corners in pixels, 0 to 200 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"canvas_color":{"type":"string","format":"color","default":"#ffffff","example":"#f3f4f6","description":"The background of the collage as a hex colour, or transparent (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"shadow":{"type":"boolean","default":false,"description":"true: a soft shadow under each picture. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"shuffle":{"type":"boolean","default":false,"description":"true: mix the order of the pictures. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"default":1,"description":"The same seed gives the same shuffle and tilt, 0 to 2147483647 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"tilt":{"type":"number","minimum":0,"maximum":45,"default":8,"description":"polaroid: the most each photo is turned, 0 to 45 degrees (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/collage.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, images, layout, order }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"images":{"type":"integer"},"layout":{"type":"string"},"order":{"type":"array","items":{"type":"integer"},"description":"The numbers of the pictures in the order they were placed."}},"required":["url","format","sizeBytes","width","height","images","layout","order"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"images","minFiles":2,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"images.collage","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/collage\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'layout=grid' \\\n  -F 'columns=1' \\\n  -F 'width=2000'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.collage({\n    \"images\": 'photo.jpg',\n    \"layout\": \"grid\",\n    \"columns\": 1,\n    \"width\": 2000\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->collage([\n    'images' => 'photo.jpg',\n    'layout' => 'grid',\n    'columns' => 1,\n    'width' => 2000,\n]);\necho $result->requestId;"}]}},"/v1/images/color-blindness":{"post":{"operationId":"images.color-blindness","summary":"Color blindness preview","description":"Show how a picture looks to a person with protanopia, deuteranopia, tritanopia or achromatopsia, at full or partial strength, alone or next to the original, to check that a design does not rely on colour alone.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to simulate.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"type":{"type":"string","enum":["protanopia","deuteranopia","tritanopia","achromatopsia"],"default":"deuteranopia","description":"protanopia (no red), deuteranopia (no green, default), tritanopia (no blue) or achromatopsia (no colour).","x-davix-h2i-enum":"ImagesColorBlindnessType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/color-blindness.js"}},"severity":{"type":"number","minimum":0.1,"maximum":1,"default":1,"description":"How strong the condition is, 0.1 to 1 (default 1: full; lower gives the milder \"anomaly\" forms).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/color-blindness.js"}},"layout":{"type":"string","enum":["single","side-by-side","all"],"default":"single","description":"single (default: only the simulation), side-by-side (original and simulation) or all (the original and all four conditions).","x-davix-h2i-enum":"ImagesColorBlindnessLayout","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/color-blindness.js"}},"labels":{"type":"boolean","default":true,"description":"With side-by-side or all: write the name above each picture (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/color-blindness.js"}},"max_width":{"type":"integer","minimum":100,"maximum":4000,"description":"Scale the picture down to this width first, 100 to 4000 (default: as is).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/color-blindness.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, type, severity, layout, tiles, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"type":{"type":"string"},"severity":{"type":"number"},"layout":{"type":"string"},"tiles":{"type":"array","items":{"type":"string"},"description":"The names shown, in order."}},"required":["url","format","sizeBytes","width","height","type","severity","layout","tiles"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.color-blindness","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/color-blindness\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'type=deuteranopia' \\\n  -F 'severity=1' \\\n  -F 'layout=single'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.colorBlindness({\n    \"images\": 'photo.jpg',\n    \"type\": \"deuteranopia\",\n    \"severity\": 1,\n    \"layout\": \"single\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->colorBlindness([\n    'images' => 'photo.jpg',\n    'type' => 'deuteranopia',\n    'severity' => 1,\n    'layout' => 'single',\n]);\necho $result->requestId;"}]}},"/v1/images/compare":{"post":{"operationId":"images.compare","summary":"Compare two images","description":"How different are two images, and where? Reports the share of differing pixels (anti-aliasing aware), structural similarity (SSIM), a perceptual-hash distance and PSNR, can limit the comparison to a region or break the difference down per grid cell, and returns a diff image that paints what changed. Images of different sizes are scaled to each other first (`resize_to`). `match` tells whether the difference stays within `max_diff_ratio`.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"imageA":{"type":"string","format":"binary","description":"The first (reference) image to compare.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"imageB":{"type":"string","format":"binary","description":"The second image to compare.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"metrics":{"type":"string","pattern":"^[a-z]+(,[a-z]+){0,3}$","description":"What to measure, comma separated: `pixel`, `ssim`, `hash`, `psnr`. Default `pixel,ssim,hash`.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown metric -> 400 invalid_parameter with the allowed metrics.","evidence":"src/processing/images/compare.js:parseOptions"}},"threshold":{"type":"number","minimum":0,"maximum":1,"default":0.1,"description":"Colour distance a pixel must exceed to count as different (0 = any change, 1 = nothing counts). Used by the pixel metric.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-1 -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"include_aa":{"type":"boolean","default":false,"description":"true = count anti-aliased edge pixels as differences too (by default they are ignored).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"alpha":{"type":"number","minimum":0,"maximum":1,"default":0.1,"description":"Opacity of the unchanged pixels in the diff image (0-1).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-1 -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"diff_color":{"type":"string","format":"color","description":"Colour that paints differing pixels in the diff image. Default red. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"max_diff_ratio":{"type":"number","minimum":0,"maximum":1,"default":0,"description":"The share of differing pixels (0-1) that still counts as a match. 0 = the images must be pixel-identical (at the threshold).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-1 -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"resize_to":{"type":"string","enum":["a","b","none"],"default":"a","description":"How to handle different sizes: `a` (default) scales B to A's size, `b` scales A to B's, `none` refuses images of different sizes.","x-davix-h2i-enum":"ImagesResizeTo","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; `none` with different sizes -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"region":{"type":"object","description":"Compare only this rectangle (in the images' pixels, after resizing): {\"x\":0,\"y\":0,\"width\":200,\"height\":100}.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not valid JSON, missing a key, or outside the image -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"grid":{"type":"string","pattern":"^[0-9]{1,2}x[0-9]{1,2}$","description":"Also report the difference of every cell of a COLUMNSxROWS grid, e.g. `4x4` (up to 32x32): where the images differ. Needs the pixel metric.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not COLUMNSxROWS or larger than 32x32 -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"diff_image":{"type":"boolean","default":true,"description":"true (default) = return a PNG that paints the differing pixels (`results[0]`). false = numbers only.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/compare.js:parseOptions"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"imageA_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the \"imageA\" input from this public http(s) address instead of uploading it. For each input send either the file or its URL, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"imageB_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the \"imageB\" input from this public http(s) address instead of uploading it. For each input send either the file or its URL, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["imageA","imageB"]},"encoding":{"region":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"comparison":{"$ref":"#/components/schemas/ImageComparison"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ImageResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["comparison"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"fixed","field":"imageA","minFiles":2,"ceiling":2,"directFiles":1,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"images.compare","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/compare\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'imageA=@photo.jpg' \\\n  -F 'imageB=@photo.jpg' \\\n  -F 'threshold=0.1' \\\n  -F 'alpha=0.1' \\\n  -F 'max_diff_ratio=0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.compare({\n    \"imageA\": 'photo.jpg',\n    \"imageB\": 'photo.jpg',\n    \"threshold\": 0.1,\n    \"alpha\": 0.1,\n    \"max_diff_ratio\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->compare([\n    'imageA' => 'photo.jpg',\n    'imageB' => 'photo.jpg',\n    'threshold' => 0.1,\n    'alpha' => 0.1,\n    'max_diff_ratio' => 0,\n]);\necho $result->requestId;"}]}},"/v1/images/composite":{"post":{"operationId":"images.composite","summary":"Composite multiple image/text/color layers onto a base image","description":"Composite multiple image/text/color layers onto a base image","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"images[0] is the base image; any further files can be referenced by layers[].imageIndex.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"layers":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"object","properties":{"type":{"type":"string","enum":["image","text","color","gradient"],"description":"Layer kind: image (an uploaded picture), text, color (a solid rectangle) or gradient.","x-davix-h2i-enum":"ImagesCompositeType","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:applyComposite"}},"imageIndex":{"type":"integer","minimum":1,"description":"For type=image: 1-based index into the uploaded images AFTER the base (the base is always images[0]).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","evidence":"src/processing/images/engine.js:applyComposite"},"x-davix-h2i-required-when":[{"field":"type","equals":"image"}]},"text":{"type":"string","description":"For type=text: the text.","x-davix-h2i-required-when":[{"field":"type","equals":"text"}]},"position":{"type":"string","enum":["center","top-left","top-right","bottom-left","bottom-right","top","bottom","left","right"],"default":"center","description":"Anchor.","x-davix-h2i-enum":"WatermarkPosition","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:applyComposite"}},"offsetX":{"type":"integer","minimum":-100000,"maximum":100000,"default":0,"description":"Horizontal nudge (px).","x-davix-h2i-behavior":{"onOutOfRange":"fallback","note":"Outside the range -> 0 (not clamped).","evidence":"src/processing/images/engine.js:applyComposite"}},"offsetY":{"type":"integer","minimum":-100000,"maximum":100000,"default":0,"description":"Vertical nudge (px).","x-davix-h2i-behavior":{"onOutOfRange":"fallback","evidence":"src/processing/images/engine.js:applyComposite"}},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"Layer opacity.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0,1]; non-numeric -> 1.","evidence":"src/processing/images/engine.js:applyComposite"}},"scale":{"type":"number","minimum":0.01,"maximum":1,"default":0.25,"description":"For type=image: size as a fraction of the smaller base dimension.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0.01,1].","evidence":"src/processing/images/engine.js:applyComposite"}},"blendMode":{"type":"string","enum":["clear","source","over","in","out","atop","dest","dest-over","dest-in","dest-out","dest-atop","xor","add","saturate","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion"],"default":"over","description":"Blend mode.","x-davix-h2i-enum":"ImagesBlendMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/engine.js:applyComposite"}},"fontSize":{"type":"integer","minimum":6,"maximum":400,"default":32,"description":"For type=text.","x-davix-h2i-behavior":{"onOutOfRange":"fallback","evidence":"src/processing/images/engine.js:applyComposite"}},"color":{"type":"string","format":"color","description":"Text color (default #ffffff) or fill color for type=color (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/shared/watermark-geometry.js:validateHexColor"}},"width":{"type":"integer","minimum":1,"description":"For type=color: rectangle width (px); default 20% of the base width.","x-davix-h2i-behavior":{"onOutOfRange":"fallback","note":"Outside [1, base width] -> default.","evidence":"src/processing/images/engine.js:applyComposite"}},"height":{"type":"integer","minimum":1,"description":"For type=color: rectangle height (px); default 20% of the base height.","x-davix-h2i-behavior":{"onOutOfRange":"fallback","evidence":"src/processing/images/engine.js:applyComposite"}},"rotate":{"type":"number","minimum":-360,"maximum":360,"description":"Rotate the layer (degrees).","x-davix-h2i-behavior":{"onOutOfRange":"reject","evidence":"src/processing/images/engine.js:applyComposite"}},"margin":{"type":"integer","minimum":0,"maximum":5000,"default":0,"description":"Edge margin (px).","x-davix-h2i-behavior":{"onOutOfRange":"fallback","evidence":"src/processing/images/engine.js:applyComposite"}},"underlay":{"type":"boolean","description":"Composite the layer under the base image.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"true or \"true\"","evidence":"src/processing/images/engine.js:applyComposite"}},"gradient":{"type":"string","enum":["linear","radial"],"default":"linear","description":"For type=gradient: the gradient kind.","x-davix-h2i-enum":"ImagesCompositeGradient","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/engine.js:buildGradientSvg"}},"stops":{"type":"array","minItems":2,"maxItems":8,"items":{"type":"object","properties":{"offset":{"type":"number","minimum":0,"maximum":1,"description":"Position along the gradient (0-1)."},"color":{"type":"string","format":"color","description":"Stop colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"opacity":{"type":"number","minimum":0,"maximum":1,"description":"Stop opacity (default 1)."}},"required":["offset","color"]},"description":"For type=gradient: 2 to 8 colour stops.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/engine.js:buildGradientSvg"}},"angle":{"type":"number","minimum":-360,"maximum":360,"description":"For a linear gradient: direction in degrees (0 = left to right, 90 = top to bottom).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","evidence":"src/processing/images/engine.js:buildGradientSvg"}},"mask":{"type":"object","properties":{"imageIndex":{"type":"integer","minimum":1,"description":"Which uploaded image (after the base) is the mask: its brightness becomes the layer's opacity."},"invert":{"type":"boolean","description":"true = black keeps and white hides."}},"required":["imageIndex"],"description":"Mask this layer with an uploaded image (white keeps, black hides).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An imageIndex that does not reference an uploaded image after the base -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyComposite"}},"fontFamily":{"type":"string","maxLength":100,"description":"Font family (GET /v1/formats lists the installed ones) or a generic name: sans-serif (default), serif, monospace, emoji. Characters the font lacks are drawn from a fallback font that has them (every script, CJK and emoji).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A family that is not installed -> 400 font_unavailable.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"fontWeight":{"type":"string","description":"Weight: thin, light, normal (default), medium, semibold, bold, heavy, or a number 100-900.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400 invalid_parameter.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"italic":{"type":"boolean","description":"true = italic (a synthetic slant if the font has none).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"align":{"type":"string","enum":["left","center","right"],"description":"Alignment of wrapped lines: left (default), center, right.","x-davix-h2i-enum":"Align","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"direction":{"type":"string","enum":["auto","ltr","rtl"],"description":"Base text direction: auto (default, from the text), ltr or rtl.","x-davix-h2i-enum":"Direction","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"lang":{"type":"string","description":"Language of the text (ja, ko, zh-CN, zh-TW, ar, fa, ...): chooses the right regional form of Han characters and the right Arabic-script face.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a language tag -> 400 invalid_parameter.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"letterSpacing":{"type":"number","minimum":-10,"maximum":100,"description":"Extra space between characters in pixels (-10 to 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"lineSpacing":{"type":"number","minimum":0.5,"maximum":4,"description":"Line height multiplier for wrapped text (0.5 to 4, default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/text-render.js:parseTextStyle"}}},"required":["type"]},"description":"Ordered layers (JSON array, max 10).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Empty or more than 10 layers -> 400. A layer entirely outside the base -> 400.","evidence":"src/processing/images/engine.js:applyComposite"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images","layers"]},"encoding":{"layers":{"contentType":"application/json"},"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ImageResult"}],"type":"object","properties":{"layerCount":{"type":"integer"}},"required":["layerCount"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"images.composite","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/composite\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'layers=[{\"type\":\"image\"}]' \\\n  -F 'output_format=jpeg' \\\n  -F 'quality=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.composite({\n    \"images\": 'photo.jpg',\n    \"layers\": [\n      {\n        \"type\": \"image\"\n      }\n    ],\n    \"output_format\": \"jpeg\",\n    \"quality\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->composite([\n    'images' => 'photo.jpg',\n    'layers' => [[\n            'type' => 'image',\n        ]],\n    'output_format' => 'jpeg',\n    'quality' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/contact-sheet":{"post":{"operationId":"images.contact-sheet","summary":"Build a photography-style contact sheet of thumbnails","description":"Build a photography-style contact sheet of thumbnails","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":100,"description":"Images (1-100).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"1-100 images (MAX_LAYOUT_IMAGES). Accepted types are enforced per upload; plan limits apply."}},"cols":{"type":"integer","minimum":1,"description":"Columns.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Math.max(1, parseInt(cols)); non-numeric -> automatic (ceil(sqrt(n))). No upper bound besides the 100-image and pixel limits.","evidence":"src/processing/images/engine.js:buildImageLayout"}},"thumbSize":{"type":"integer","minimum":1,"default":150,"description":"Square thumbnail size (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels, at least 1. Empty -> 150. Non-numeric, 0 or negative -> 400 invalid_parameter. A sheet above the plan's result-size limits -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildContactSheet; src/shared/param-validation.js"}},"spacing":{"type":"integer","minimum":0,"maximum":500,"default":10,"description":"Gap between thumbnails (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels from 0 to 500; anything else -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"Sheet / letterbox background (hex, optionally with alpha). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Any CSS colour (names, #rgb, #rrggbb, #rrggbbaa, rgb()/rgba()). Empty -> the default colour. An unparseable value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"labels":{"type":"string","enum":["none","filename","index"],"default":"none","description":"Write a caption under every picture: `filename` (the uploaded file's name), `index` (1, 2, 3, ...) or `none` (default).","x-davix-h2i-enum":"ImagesLabels","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelFontFamily":{"type":"string","maxLength":100,"description":"Font of the captions (GET /v1/formats lists the installed families). Default sans-serif; any script works.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A family that is not installed -> 400 font_unavailable.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelFontSize":{"type":"integer","minimum":6,"maximum":100,"description":"Caption size in pixels (6-100, default 14).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 6-100 -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelColor":{"type":"string","format":"color","description":"Caption colour (default #333333). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"padding":{"type":"integer","minimum":0,"maximum":500,"default":0,"description":"Empty margin around the whole sheet in pixels (0-500), on top of the spacing between pictures.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-500 -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/LayoutResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"images","minFiles":1,"ceiling":100,"directFiles":100,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"images.contact-sheet","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","max_output_dimension_px","max_output_pixels","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/contact-sheet\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'cols=1' \\\n  -F 'thumbSize=150' \\\n  -F 'spacing=10'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.contactSheet({\n    \"images\": 'photo.jpg',\n    \"cols\": 1,\n    \"thumbSize\": 150,\n    \"spacing\": 10\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->contactSheet([\n    'images' => 'photo.jpg',\n    'cols' => 1,\n    'thumbSize' => 150,\n    'spacing' => 10,\n]);\necho $result->requestId;"}]}},"/v1/images/convert":{"post":{"operationId":"images.convert","summary":"Convert an image to another format","description":"Converts each uploaded image to `output_format` without changing its pixels: PNG to WebP, JPEG to AVIF, TIFF to JPEG, SVG to PNG, an animated GIF to an animated WebP, and so on. Quality, colour profile, pixel density and metadata (strip, keep, or set author/copyright/GPS/EXIF) are controlled with the shared output parameters. Multi-page sources (TIFF, animated GIF/WebP) convert their first page unless `page` or `pages` says otherwise.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s) to convert. Every file is converted with the same parameters.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted formats are judged by the file's content, not its name or declared type; the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Missing -> 400 missing_field. Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"page":{"type":"integer","minimum":1,"default":1,"description":"Which page or frame of a multi-page source (TIFF, animated GIF/WebP) to convert, counting from 1. Ignored for single-page images. Not combined with `pages`.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"A page beyond the source's last page -> 400 invalid_parameter.","evidence":"src/api/images/convert.js"}},"pages":{"type":"string","description":"Convert several pages of a multi-page source into separate result files: `all`, or a list/range such as `1-3,5`. Ignored for single-page images. Not combined with `page`.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not `all` or a page list inside the source -> 400 invalid_parameter. More pages than the plan or the 200-page ceiling allows -> 400 invalid_parameter.","evidence":"src/api/images/convert.js"}},"animated":{"type":"boolean","default":true,"description":"true (default) = an animated GIF/WebP source stays animated when the output format can hold animation (GIF, WebP). false = convert only one frame.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"false\" disables it","evidence":"src/api/images/convert.js"}},"ico_sizes":{"type":"string","pattern":"^[0-9]{1,3}(,[0-9]{1,3}){0,15}$","description":"For output_format=ico: the icon sizes to include, comma separated (1-256 px), e.g. `16,32,48,256`. Default 16,32,48,256. Sizes larger than the source are skipped.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A size outside 1-256 or a malformed list -> 400 invalid_parameter.","evidence":"src/api/images/convert.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images","output_format"]},"encoding":{"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/ImageResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dependency_unavailable","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","format_not_allowed","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.convert","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/convert\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'output_format=jpeg' \\\n  -F 'page=1' \\\n  -F 'quality=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.convert({\n    \"images\": 'photo.jpg',\n    \"output_format\": \"jpeg\",\n    \"page\": 1,\n    \"quality\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->convert([\n    'images' => 'photo.jpg',\n    'output_format' => 'jpeg',\n    'page' => 1,\n    'quality' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/credentials":{"post":{"operationId":"images.credentials","summary":"Content Credentials","description":"Read the Content Credentials (C2PA) that a picture may carry: the tool that made it, the edits recorded, the signer, and whether the picture is marked as made or changed by AI. It reads what the file says; it does not check the signature.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to read (JPEG, PNG, WebP, HEIC/AVIF, TIFF).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ originalName, format, hasContentCredentials, signatureChecked, aiGenerated, digitalSourceType, digitalSourceMeaning, claimGenerator, title, actions, assertions, signer, certificates, manifests?, note }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string"},"format":{"type":"string"},"hasContentCredentials":{"type":"boolean","description":"true when a C2PA manifest is in the file. false does not show that the picture is not genuine: most tools do not add one and many sites remove it."},"signatureChecked":{"type":"boolean","description":"Always false: the signature and the hashes are not verified here."},"aiGenerated":{"type":"boolean","description":"true when the metadata marks the picture as made by an AI model or an algorithm."},"digitalSourceType":{"type":"string","nullable":true},"digitalSourceMeaning":{"type":"string","nullable":true},"claimGenerator":{"type":"string","nullable":true,"description":"The tool that wrote the manifest."},"title":{"type":"string","nullable":true},"actions":{"type":"array","items":{"type":"string"},"description":"The edits recorded, such as c2pa.created, c2pa.edited, c2pa.cropped."},"assertions":{"type":"array","items":{"type":"string"},"description":"The labels of the statements in the manifest."},"signer":{"type":"string","nullable":true,"description":"Who signed it: the subject of the first certificate."},"certificates":{"type":"array","items":{"type":"object"},"description":"The signing certificates: subject, issuer, notBefore, notAfter."},"manifests":{"type":"integer","description":"How many manifests were found."},"note":{"type":"string"}},"required":["format","hasContentCredentials","signatureChecked","aiGenerated","actions","assertions","certificates","note"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.credentials","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/credentials\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'validate_only=false' \\\n  -F 'presetId=00000000-0000-4000-8000-000000000000' \\\n  -F 'app=x'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.credentials({\n    \"images\": 'photo.jpg',\n    \"validate_only\": false,\n    \"presetId\": \"00000000-0000-4000-8000-000000000000\",\n    \"app\": \"x\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->credentials([\n    'images' => 'photo.jpg',\n    'validate_only' => false,\n    'presetId' => '00000000-0000-4000-8000-000000000000',\n    'app' => 'x',\n]);\necho $result->requestId;"}]}},"/v1/images/crop-photos":{"post":{"operationId":"images.crop-photos","summary":"Crop photos from a scan","description":"Find several photos laid on a scanner bed or a table, straighten each one and cut it out as its own picture, in reading order.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The scan(s) with the photos on them.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"min_area":{"type":"number","minimum":0.1,"maximum":60,"default":2,"description":"The smallest shape that counts as a photo, in percent of the whole scan (default 2). Raise it to ignore dust, labels and torn edges.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"tolerance":{"type":"number","minimum":2,"maximum":200,"default":28,"description":"How different from the background a pixel must be to belong to a photo, 2 to 200 (default 28). Lower it for photos with pale edges.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"background":{"type":"string","format":"color","default":"auto","example":"#f4f4f0","description":"The colour of the scanner bed: auto (default, read from the border of the scan), white, black or a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"deskew":{"type":"boolean","default":true,"description":"true (default): turn each photo upright. false: only cut the box around it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"max_photos":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"The most photos to cut out, 1 to 100 (default 20).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"edge_trim":{"type":"integer","minimum":0,"maximum":100,"default":2,"description":"Pixels to cut off the edge of each photo to remove the scanner-bed fringe (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"close":{"type":"integer","minimum":0,"maximum":30,"default":2,"description":"How far apart bits of one photo may be and still be joined, in pixels of a 900 px working copy (default 2). Raise it for photos with white borders or pale areas.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"order":{"type":"string","enum":["reading","size"],"default":"reading","description":"reading (default: top to bottom, left to right) or size (the largest first).","x-davix-h2i-enum":"ImagesOrder","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"padding":{"type":"integer","minimum":0,"maximum":200,"default":0,"description":"Extra pixels of the scan to keep around each photo (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/crop-photos.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, originalName, index, angle, areaPercent, box }], count, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"index":{"type":"integer","description":"The number of the photo on its scan, in the order chosen."},"angle":{"type":"number","description":"The turn that was applied, in degrees."},"areaPercent":{"type":"number","description":"The share of the scan the photo covers, in percent."},"box":{"type":"object","description":"The box around the photo on the scan: { x, y, width, height } in pixels."}},"required":["url","format","sizeBytes","width","height","index","angle","areaPercent","box"]}},"count":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","count"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.crop-photos","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/crop-photos\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'min_area=2' \\\n  -F 'tolerance=28' \\\n  -F 'background=#f4f4f0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.cropPhotos({\n    \"images\": 'photo.jpg',\n    \"min_area\": 2,\n    \"tolerance\": 28,\n    \"background\": \"#f4f4f0\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->cropPhotos([\n    'images' => 'photo.jpg',\n    'min_area' => 2,\n    'tolerance' => 28,\n    'background' => '#f4f4f0',\n]);\necho $result->requestId;"}]}},"/v1/images/decode-codes":{"post":{"operationId":"images.decode-codes","summary":"Read QR codes and barcodes from images","description":"Find and decode every QR code and barcode (code128, code39, ean13, ean8, upca, itf, codabar, datamatrix, pdf417, aztec, qrcode) in one or more images, with the position of each. Counts one file per image.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"One or more images that may contain QR codes or barcodes.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"formats":{"type":"array","items":{"type":"string","enum":["code128","code39","ean13","ean8","upca","itf","codabar","datamatrix","pdf417","aztec","qrcode"],"x-davix-h2i-enum":"ImagesSymbology"},"description":"Only look for these symbologies (default: all of them): comma-separated or a JSON array.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/images/codes.js"}},"try_harder":{"type":"boolean","default":true,"description":"Spend more effort on difficult images (rotated, blurred, small codes). Default true.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/images/codes.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"formats":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ count, results: [{ originalName, width, height, count, codes: [{ text, symbology, position, orientation }] }] }","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string","nullable":true},"width":{"type":"integer"},"height":{"type":"integer"},"count":{"type":"integer"},"codes":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"symbology":{"type":"string"},"position":{"type":"array","items":{"type":"object"},"nullable":true,"description":"The four corners of the code as { x, y } in pixels."},"orientation":{"type":"number","nullable":true}},"required":["text","symbology"]}}},"required":["width","height","count","codes"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["count","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.decode-codes","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/decode-codes\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'formats=[\"code128\"]' \\\n  -F 'try_harder=true' \\\n  -F 'validate_only=false'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.decodeCodes({\n    \"images\": 'photo.jpg',\n    \"formats\": [\n      \"code128\"\n    ],\n    \"try_harder\": true,\n    \"validate_only\": false\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->decodeCodes([\n    'images' => 'photo.jpg',\n    'formats' => ['code128'],\n    'try_harder' => true,\n    'validate_only' => false,\n]);\necho $result->requestId;"}]}},"/v1/images/edit-animation":{"post":{"operationId":"images.edit-animation","summary":"Edit animation","description":"Edit an animated GIF or WebP: cut frames, keep every Nth frame, reverse it, play it back and forth, change the speed or every frame delay, the loop count, the size, flip or turn it, and save as GIF, animated WebP or APNG.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The animated GIF or WebP to edit.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"trim_from":{"type":"integer","minimum":1,"maximum":100000,"description":"The first frame to keep, counting from 1 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"trim_to":{"type":"integer","minimum":1,"maximum":100000,"description":"The last frame to keep (default: the last).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"every":{"type":"integer","minimum":1,"maximum":50,"default":1,"description":"Keep every Nth frame, 1 to 50 (default 1: all). The delays of the dropped frames are added, so the running time stays the same.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"reverse":{"type":"boolean","default":false,"description":"true: play it backwards. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"boomerang":{"type":"boolean","default":false,"description":"true: play forward and then back (the end frames are not shown twice). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"speed":{"type":"number","minimum":0.1,"maximum":10,"default":1,"description":"Play speed, 0.1 to 10 (default 1; 2 is twice as fast).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"delay":{"type":"integer","minimum":20,"maximum":10000,"description":"Set every frame to this delay in milliseconds, 20 to 10000, before speed is applied.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"loop":{"type":"integer","minimum":0,"maximum":65535,"description":"How many times it plays, 0 for ever, up to 65535 (default: as the source).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"width":{"type":"integer","minimum":8,"maximum":4000,"description":"Resize to this width in pixels, 8 to 4000 (the height follows unless given).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"height":{"type":"integer","minimum":8,"maximum":4000,"description":"Resize to this height in pixels, 8 to 4000.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"flip":{"type":"string","enum":["none","horizontal","vertical","both"],"default":"none","description":"none (default), horizontal, vertical or both.","x-davix-h2i-enum":"ImagesFlip","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"rotate":{"type":"integer","minimum":0,"maximum":270,"default":0,"description":"Turn clockwise: 0 (default), 90, 180 or 270 degrees.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"format":{"type":"string","enum":["gif","webp","apng"],"description":"The result: gif, webp or apng (default: gif for a GIF, webp for anything else).","x-davix-h2i-enum":"ImagesEditAnimationFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"default":90,"description":"With webp: the quality, 1 to 100 (default 90; 100 is lossless).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/edit-animation.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, framesIn, framesOut, durationMsIn, durationMsOut, loop, frameDelays, sourceFormat, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"framesIn":{"type":"integer"},"framesOut":{"type":"integer"},"durationMsIn":{"type":"integer"},"durationMsOut":{"type":"integer"},"loop":{"type":"integer"},"frameDelays":{"type":"array","items":{"type":"integer"},"description":"The delay of each frame in ms (the first 200)."},"sourceFormat":{"type":"string"}},"required":["url","format","sizeBytes","width","height","framesIn","framesOut","durationMsIn","durationMsOut","loop","frameDelays"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.edit-animation","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/edit-animation\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'trim_from=1' \\\n  -F 'trim_to=1' \\\n  -F 'every=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.editAnimation({\n    \"images\": 'photo.jpg',\n    \"trim_from\": 1,\n    \"trim_to\": 1,\n    \"every\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->editAnimation([\n    'images' => 'photo.jpg',\n    'trim_from' => 1,\n    'trim_to' => 1,\n    'every' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/favicon":{"post":{"operationId":"images.favicon","summary":"Generate a favicon and app-icon pack","description":"One logo in, every icon a site or installable web app needs out: a multi-size `favicon.ico`, 16 and 32 px PNGs, the 180 px Apple touch icon, the 192 and 512 px web-app icons plus a maskable 512 px icon (artwork kept inside the safe zone), and a Windows tile. The answer also carries the web app manifest and the `<head>` snippet that wires the files in. A whole pack counts as one file against your plan. Send a square SVG, or a PNG of at least 512x512, for the sharpest result.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The logo or icon to build the pack from.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted formats are judged by the file's content, not its name or declared type. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"include":{"type":"string","pattern":"^[a-z]+(,[a-z]+){0,4}$","description":"Which parts of the pack to build, comma separated: `ico`, `png`, `apple`, `pwa`, `windows`. Default: all of them.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown group -> 400 invalid_parameter with the allowed groups.","evidence":"src/api/images/favicon.js"}},"sizes":{"type":"string","pattern":"^[0-9]{2,4}(,[0-9]{2,4}){0,15}$","description":"Extra square PNG sizes to add (16-1024), comma separated, e.g. `64,128`. Each is named icon-<size>x<size>.png.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A size outside 16-1024 or more than 16 sizes -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"background":{"type":"string","format":"color","description":"Colour behind icons that cannot be transparent (Apple touch icon, maskable icon). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"padding":{"type":"integer","minimum":0,"maximum":40,"default":0,"description":"Empty margin around the artwork as a percentage of each icon (0-40).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-40 -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"app_name":{"type":"string","maxLength":100,"description":"Name written into the web app manifest.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 100 characters or control characters -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"short_name":{"type":"string","maxLength":30,"description":"Short name for the manifest (home-screen label).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 30 characters or control characters -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"theme_color":{"type":"string","format":"color","description":"Manifest `theme_color` and the theme-color <meta> tag. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"background_color":{"type":"string","format":"color","description":"Manifest `background_color` (splash screen). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"start_url":{"type":"string","maxLength":200,"default":"/","description":"Manifest `start_url`: a path on your site. Default `/`.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A full URL or characters outside a plain path -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"display":{"type":"string","enum":["standalone","minimal-ui","fullscreen","browser"],"default":"standalone","description":"Manifest `display` mode.","x-davix-h2i-enum":"ImagesDisplay","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"path_prefix":{"type":"string","maxLength":200,"default":"/","description":"URL path the icon files will be served from, used in the manifest and the <head> snippet. Default `/`.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an absolute URL path such as /assets/icons/ -> 400 invalid_parameter.","evidence":"src/api/images/favicon.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/FaviconFile"}},"manifest":{"type":"object","additionalProperties":true,"description":"The web app manifest (site.webmanifest) for the icons in this pack."},"html":{"type":"string","description":"The <head> snippet that links the icons and the manifest."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","manifest","html"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.favicon","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/favicon\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'padding=0' \\\n  -F 'display=standalone' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.favicon({\n    \"images\": 'photo.jpg',\n    \"padding\": 0,\n    \"display\": \"standalone\",\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->favicon([\n    'images' => 'photo.jpg',\n    'padding' => 0,\n    'display' => 'standalone',\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/images/filters":{"post":{"operationId":"images.filters","summary":"Artistic filters","description":"Apply an artistic filter: sepia, vintage, duotone, posterize, pixelate, halftone, pencil sketch, vignette or film grain, each with its own settings and a strength that blends it with the original.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to filter.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"filter":{"type":"string","enum":["sepia","vintage","duotone","posterize","pixelate","halftone","sketch","vignette","grain"],"description":"The filter: sepia, vintage, duotone, posterize, pixelate, halftone, sketch, vignette, grain.","x-davix-h2i-enum":"ImagesFilter","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"intensity":{"type":"number","minimum":0,"maximum":100,"default":100,"description":"How much of the effect is mixed in, 0 to 100 (default 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"fade":{"type":"number","minimum":0,"maximum":100,"default":30,"description":"vintage: how much the blacks are lifted, 0 to 100 (default 30).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"shadow_color":{"type":"string","format":"color","default":"#1b1464","example":"#1a73e8","description":"duotone: the colour of the dark tones (default #1b1464). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"highlight_color":{"type":"string","format":"color","default":"#f9d423","example":"#1a73e8","description":"duotone: the colour of the light tones (default #f9d423). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"levels":{"type":"integer","minimum":2,"maximum":16,"default":4,"description":"posterize: the number of tones per colour, 2 to 16 (default 4).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"size":{"type":"integer","minimum":2,"maximum":200,"description":"pixelate: the block size in pixels, halftone: the dot cell size in pixels, 2 to 200 (default 12 and 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"dot_color":{"type":"string","format":"color","default":"#000000","example":"#1a73e8","description":"halftone: the colour of the dots (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"paper":{"type":"string","format":"color","default":"#ffffff","example":"#1a73e8","description":"halftone: the colour of the paper (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"detail":{"type":"number","minimum":1,"maximum":10,"default":5,"description":"sketch: how thick the pencil lines are, 1 (fine) to 10 (thick; default 5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"radius":{"type":"number","minimum":10,"maximum":100,"default":70,"description":"vignette: how far from the centre the darkening starts, in percent, 10 to 100 (default 70).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"darkness":{"type":"number","minimum":0,"maximum":100,"default":60,"description":"vignette: how dark the corners get, 0 to 100 (default 60).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"amount":{"type":"number","minimum":0,"maximum":100,"default":40,"description":"grain: how strong the film grain is, 0 to 100 (default 40).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/filters.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images","filter"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, filter, intensity, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"filter":{"type":"string"},"intensity":{"type":"number"}},"required":["url","format","sizeBytes","width","height","filter","intensity"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.filters","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/filters\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'filter=sepia' \\\n  -F 'intensity=100' \\\n  -F 'fade=30'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.filters({\n    \"images\": 'photo.jpg',\n    \"filter\": \"sepia\",\n    \"intensity\": 100,\n    \"fade\": 30\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->filters([\n    'images' => 'photo.jpg',\n    'filter' => 'sepia',\n    'intensity' => 100,\n    'fade' => 30,\n]);\necho $result->requestId;"}]}},"/v1/images/find-duplicates":{"post":{"operationId":"images.find-duplicates","summary":"Find duplicates","description":"Find which pictures are the same picture: exact copies, and the same picture saved again at another size, format or quality. Each group names the file worth keeping.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":2,"description":"The pictures to compare (at least two).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"threshold":{"type":"integer","minimum":0,"maximum":32,"default":10,"description":"How different two pictures may be and still count as the same, 0 to 32 (default 10; 0 finds only pictures that look identical). It is the number of differing bits of a 64-bit fingerprint.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/find-duplicates.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ scanned, groupCount, redundant, savedBytes, groups: [{ type, keep, files: [{ index, name, width, height, sizeBytes, distance }] }], unique: [{ index, name }] }","content":{"application/json":{"schema":{"type":"object","properties":{"scanned":{"type":"integer"},"groupCount":{"type":"integer"},"redundant":{"type":"integer","description":"How many files could be deleted (every file of a group except the one to keep)."},"savedBytes":{"type":"integer","description":"The size of those files together."},"groups":{"type":"array","items":{"type":"object"},"description":"Each group: type (exact = the same bytes, similar = the same picture saved again), keep (the index of the file worth keeping: the most pixels, then the largest file) and files, each with index, name, width, height, sizeBytes and distance from the kept file (0 to 64)."},"unique":{"type":"array","items":{"type":"object"},"description":"The pictures that have no copy: { index, name }."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["scanned","groupCount","redundant","savedBytes","groups","unique"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"images","minFiles":2,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"images.find-duplicates","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/find-duplicates\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'threshold=10' \\\n  -F 'validate_only=false' \\\n  -F 'presetId=00000000-0000-4000-8000-000000000000'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.findDuplicates({\n    \"images\": 'photo.jpg',\n    \"threshold\": 10,\n    \"validate_only\": false,\n    \"presetId\": \"00000000-0000-4000-8000-000000000000\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->findDuplicates([\n    'images' => 'photo.jpg',\n    'threshold' => 10,\n    'validate_only' => false,\n    'presetId' => '00000000-0000-4000-8000-000000000000',\n]);\necho $result->requestId;"}]}},"/v1/images/frames":{"post":{"operationId":"images.frames","summary":"Extract individual frames/pages from an animated GIF/WebP or multi-page TIFF","description":"Extract individual frames/pages from an animated GIF/WebP or multi-page TIFF","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"One animated GIF/WebP or multi-page TIFF.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"frames":{"type":"string","pattern":"^\\s*\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*\\s*$","description":"1-based frame selector: comma list of indexes/ranges, e.g. \"1,3-5\". Default = all frames (max 200).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Bad syntax, index out of range, more than 200 frames, or over 100,000,000 total pixels -> 400.","evidence":"src/processing/images/engine.js:parseFrameSelector"}},"format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"Output format of each frame.","x-davix-h2i-enum":"RasterFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:extractFrames"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"frameCount":{"type":"integer"},"sourceFormat":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"frame":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"delayMs":{"type":"integer","nullable":true},"sizeBytes":{"type":"integer"}},"required":["url","frame","width","height","sizeBytes"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["frameCount","sourceFormat","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.frames","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/frames\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'format=png' \\\n  -F 'output_bundle=zip' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.frames({\n    \"images\": 'photo.jpg',\n    \"format\": \"png\",\n    \"output_bundle\": \"zip\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->frames([\n    'images' => 'photo.jpg',\n    'format' => 'png',\n    'output_bundle' => 'zip',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/images/grid":{"post":{"operationId":"images.grid","summary":"Arrange multiple images into a grid layout","description":"Arrange multiple images into a grid layout","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":100,"description":"Images to arrange (1-100).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"1-100 images (MAX_LAYOUT_IMAGES). Accepted types are enforced per upload; plan limits apply."}},"cols":{"type":"integer","minimum":1,"description":"Columns (default ceil(sqrt(n))).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Math.max(1, parseInt(cols)); non-numeric -> automatic (ceil(sqrt(n))). No upper bound besides the 100-image and pixel limits.","evidence":"src/processing/images/engine.js:buildImageLayout"}},"cellWidth":{"type":"integer","minimum":1,"description":"Cell width (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels, at least 1. Empty -> the largest input dimension. Non-numeric, 0 or negative -> 400 invalid_parameter. A sheet above the plan's result-size limits (max_output_dimension_px, max_output_pixels) or the raw-effect pixel limit -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"cellHeight":{"type":"integer","minimum":1,"description":"Cell height (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels, at least 1. Empty -> the largest input dimension. Non-numeric, 0 or negative -> 400 invalid_parameter. A sheet above the plan's result-size limits (max_output_dimension_px, max_output_pixels) or the raw-effect pixel limit -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"spacing":{"type":"integer","minimum":0,"maximum":500,"default":0,"description":"Gap between cells (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels from 0 to 500; anything else -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"Sheet / letterbox background (hex, optionally with alpha). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Any CSS colour (names, #rgb, #rrggbb, #rrggbbaa, rgb()/rgba()). Empty -> the default colour. An unparseable value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"labels":{"type":"string","enum":["none","filename","index"],"default":"none","description":"Write a caption under every picture: `filename` (the uploaded file's name), `index` (1, 2, 3, ...) or `none` (default).","x-davix-h2i-enum":"ImagesLabels","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelFontFamily":{"type":"string","maxLength":100,"description":"Font of the captions (GET /v1/formats lists the installed families). Default sans-serif; any script works.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A family that is not installed -> 400 font_unavailable.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelFontSize":{"type":"integer","minimum":6,"maximum":100,"description":"Caption size in pixels (6-100, default 14).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 6-100 -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelColor":{"type":"string","format":"color","description":"Caption colour (default #333333). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"padding":{"type":"integer","minimum":0,"maximum":500,"default":0,"description":"Empty margin around the whole sheet in pixels (0-500), on top of the spacing between pictures.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-500 -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/LayoutResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"images","minFiles":1,"ceiling":100,"directFiles":100,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"images.grid","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","max_output_dimension_px","max_output_pixels","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/grid\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'cols=1' \\\n  -F 'cellWidth=1' \\\n  -F 'cellHeight=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.grid({\n    \"images\": 'photo.jpg',\n    \"cols\": 1,\n    \"cellWidth\": 1,\n    \"cellHeight\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->grid([\n    'images' => 'photo.jpg',\n    'cols' => 1,\n    'cellWidth' => 1,\n    'cellHeight' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/inspect":{"post":{"operationId":"images.inspect","summary":"Heavier, multi-check image analysis","description":"Heavier, multi-check image analysis","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s). `similarity` needs at least 2.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"checks":{"type":"array","minItems":1,"items":{"type":"string","enum":["colors","palette","hash","similarity","transparency","quality","efficiency","dimensions","aspectratio","format","animation","metadatasummary","optimization","stats"],"x-davix-h2i-enum":"ImagesChecksItem"},"description":"Checks to run: a comma-separated string (colors,palette,...) or a JSON array of names.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Empty or unknown check name -> 400 invalid_parameter (details.unknown).","evidence":"src/processing/images/engine.js:runInspectChecks"}},"options":{"type":"object","properties":{"paletteSize":{"type":"integer","minimum":1,"maximum":16,"default":5,"description":"Palette colors.","x-davix-h2i-behavior":{"onOutOfRange":"fallback","note":"Outside [1,16] -> 5."}},"hashType":{"type":"string","enum":["phash","md5","sha1","sha256"],"default":"phash","description":"Hash algorithm.","x-davix-h2i-enum":"ImagesHashType","x-davix-h2i-behavior":{"onInvalid":"fallback","note":"Unknown -> phash."}},"qualitySample":{"type":"integer","minimum":64,"maximum":512,"default":256,"description":"Quality sample size.","x-davix-h2i-behavior":{"onOutOfRange":"fallback"}},"transparencySample":{"type":"integer","minimum":16,"maximum":128,"default":64,"description":"Transparency sample size.","x-davix-h2i-behavior":{"onOutOfRange":"fallback"}},"similarityMode":{"type":"string","enum":["pairs","tofirst"],"default":"pairs","description":"Similarity comparison mode (pairs supports up to 25 images).","x-davix-h2i-enum":"ImagesSimilarityMode","x-davix-h2i-behavior":{"onInvalid":"fallback"}},"similarityThreshold":{"type":"integer","minimum":0,"maximum":64,"default":8,"description":"Max Hamming distance counted as similar.","x-davix-h2i-behavior":{"onOutOfRange":"fallback"}},"efficiencyFormat":{"type":"string","description":"Format used by the efficiency check."},"efficiencyQuality":{"type":"integer","description":"Quality used by the efficiency check."}},"description":"Tuning options (JSON object). When omitted, these keys are read from the request body itself.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON -> 400. Out-of-range values fall back to defaults (clampInt).","evidence":"src/processing/images/engine.js:runInspectChecks"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images","checks"]},"encoding":{"checks":{"contentType":"application/json"},"options":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/InspectEntry"}},"batch":{"type":"object","properties":{"similarity":{"type":"array","items":{"type":"object"},"description":"Only with the similarity check: pairs mode -> {aIndex,bIndex,distance,isSimilar}; toFirst mode -> {index,distance,isSimilar}."}},"required":["similarity"]},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.inspect","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/inspect\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'checks=[\"colors\"]' \\\n  -F 'options={}' \\\n  -F 'validate_only=false'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.inspect({\n    \"images\": 'photo.jpg',\n    \"checks\": [\n      \"colors\"\n    ],\n    \"options\": {},\n    \"validate_only\": false\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->inspect([\n    'images' => 'photo.jpg',\n    'checks' => ['colors'],\n    'options' => [\n\n    ],\n    'validate_only' => false,\n]);\necho $result->requestId;"}]}},"/v1/images/invisible-watermark":{"post":{"operationId":"images.invisible-watermark","summary":"Invisible watermark","description":"Hide a short message (up to 64 bytes) in the brightness of a picture to show where it came from, and read it back later with the same key. It survives JPEG compression; it does not survive resizing or an uneven crop.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to mark, or to read the message of.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"operation":{"type":"string","enum":["embed","extract"],"default":"embed","description":"embed (default: hide the message) or extract (read it back).","x-davix-h2i-enum":"ImagesOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/invisible-watermark.js"}},"message":{"type":"string","example":"owner:acme 2026-11","description":"embed: the text to hide, up to 64 bytes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/invisible-watermark.js"}},"key":{"type":"string","example":"my secret","description":"A secret that decides where the message is hidden (default: none). extract needs the same key.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/invisible-watermark.js"}},"strength":{"type":"integer","minimum":1,"maximum":10,"description":"How strongly it is hidden, 1 to 10 (default 4 when embedding). Stronger survives more compression but may become visible. extract tries all strengths when this is not given.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/invisible-watermark.js"}},"format":{"type":"string","enum":["png","jpeg"],"default":"png","description":"embed: png (default, lossless) or jpeg.","x-davix-h2i-enum":"ImagesInvisibleWatermarkFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/invisible-watermark.js"}},"quality":{"type":"integer","minimum":40,"maximum":100,"default":92,"description":"embed with jpeg: the quality, 40 to 100 (default 92).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/invisible-watermark.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"embed: { results: [{ operation, bytes, copies, blocks, strength, verified, url, format, sizeBytes, width, height }] }. extract: { results: [{ operation, found, message?, bytes?, copies?, confidence?, strength?, reason? }] }.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string"},"operation":{"type":"string","enum":["embed","extract"]},"bytes":{"type":"integer","description":"embed: the size of the message in bytes."},"copies":{"type":"integer","description":"How often the message is repeated over the picture."},"blocks":{"type":"integer"},"strength":{"type":"integer"},"verified":{"type":"boolean","description":"embed: the message was read back from the saved file."},"found":{"type":"boolean","description":"extract: whether a message was found."},"message":{"type":"string","description":"extract: the hidden message."},"confidence":{"type":"number","description":"extract: how exactly the picture sits on the grid of the message (0 to 1)."},"reason":{"type":"string","description":"extract: why nothing was found."},"url":{"type":"string","format":"uri","description":"embed: the marked picture."},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"}},"required":["operation"]}},"operation":{"type":"string","enum":["embed","extract"]},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","operation"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.invisible-watermark","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/invisible-watermark\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'operation=embed' \\\n  -F 'message=owner:acme 2026-11' \\\n  -F 'key=my secret'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.invisibleWatermark({\n    \"images\": 'photo.jpg',\n    \"operation\": \"embed\",\n    \"message\": \"owner:acme 2026-11\",\n    \"key\": \"my secret\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->invisibleWatermark([\n    'images' => 'photo.jpg',\n    'operation' => 'embed',\n    'message' => 'owner:acme 2026-11',\n    'key' => 'my secret',\n]);\necho $result->requestId;"}]}},"/v1/images/meme":{"post":{"operationId":"images.meme","summary":"Meme maker","description":"Write a top and a bottom text on a picture in the classic bold outlined meme style, or in caption bars above and below the picture. The text is made capitals, split into lines that fit and sized to fill the picture; the font, colours, outline, shadow and alignment are yours.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to write on.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"top_text":{"type":"string","example":"one does not simply","description":"The text at the top (up to 300 characters; a new line starts a new line). Give top_text, bottom_text or both.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"bottom_text":{"type":"string","example":"make a meme","description":"The text at the bottom.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"style":{"type":"string","enum":["overlay","bar-top","bar-bottom","bar-both"],"default":"overlay","description":"overlay (default: the text on the picture), bar-top, bar-bottom (all the text in a bar) or bar-both (top text above, bottom text below).","x-davix-h2i-enum":"ImagesMemeStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"font":{"type":"string","enum":["impact","sans","serif","mono","comic"],"default":"impact","description":"The font: impact, sans, serif, mono, comic (default impact).","x-davix-h2i-enum":"ImagesFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"uppercase":{"type":"boolean","default":true,"description":"true (default): write the text in capitals.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"text_color":{"type":"string","format":"color","default":"#ffffff","example":"#ffff00","description":"The letters as a hex colour (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"stroke_color":{"type":"string","format":"color","default":"#000000","example":"#000000","description":"The outline as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"stroke_width":{"type":"number","minimum":0,"maximum":30,"default":6,"description":"The outline thickness as a percentage of the letter size, 0 to 30 (default 6).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"font_size":{"type":"number","minimum":2,"maximum":40,"default":12,"description":"The biggest letter size as a percentage of the picture height, 2 to 40 (default 12). Long text is made smaller to fit.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"align":{"type":"string","enum":["center","left","right"],"default":"center","description":"center (default), left or right.","x-davix-h2i-enum":"ImagesAlign","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"padding":{"type":"number","minimum":0,"maximum":20,"default":3,"description":"The space at the edges as a percentage of the width, 0 to 20 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"line_height":{"type":"number","minimum":0.8,"maximum":2,"default":1.05,"description":"The line spacing as a multiple of the letter size, 0.8 to 2 (default 1.05).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"max_lines":{"type":"integer","minimum":1,"maximum":8,"default":4,"description":"The most lines for each text, 1 to 8 (default 4).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"shadow":{"type":"boolean","default":false,"description":"overlay: true adds a soft shadow under the letters. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"bar_color":{"type":"string","format":"color","default":"#ffffff","example":"#ffffff","description":"With bars: the colour of the bar as a hex colour (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"bar_text_color":{"type":"string","format":"color","default":"#000000","example":"#000000","description":"With bars: the colour of the letters as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"max_width":{"type":"integer","minimum":100,"maximum":4000,"description":"Scale the picture down to this width first, 100 to 4000 (default: as is).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"letter_spacing":{"type":"number","minimum":-5,"maximum":20,"default":0,"description":"Extra space between letters in pixels, -5 to 20 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/meme.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, topLines, bottomLines, topSize, bottomSize, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"topLines":{"type":"integer","description":"How many lines the top text took."},"bottomLines":{"type":"integer"},"topSize":{"type":"integer","description":"The letter size used for the top text in pixels."},"bottomSize":{"type":"integer"}},"required":["url","format","sizeBytes","width","height","topLines","bottomLines","topSize","bottomSize"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.meme","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/meme\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'top_text=one does not simply' \\\n  -F 'bottom_text=make a meme' \\\n  -F 'style=overlay'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.meme({\n    \"images\": 'photo.jpg',\n    \"top_text\": \"one does not simply\",\n    \"bottom_text\": \"make a meme\",\n    \"style\": \"overlay\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->meme([\n    'images' => 'photo.jpg',\n    'top_text' => 'one does not simply',\n    'bottom_text' => 'make a meme',\n    'style' => 'overlay',\n]);\necho $result->requestId;"}]}},"/v1/images/metadata":{"post":{"operationId":"images.metadata","summary":"Read, edit or remove the metadata of images (EXIF, GPS, IPTC, XMP, maker notes ...)","description":"With nothing asked it lists every tag of the image, grouped and marked with what it can reveal. With clean, mode, remove, remove_groups or set it returns a new image with the change: the pixels are never decoded or re-compressed, and \"remove everything\" keeps only what the picture needs to look the same (colour profile, rotation, size on paper).","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s) to inspect.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"mode":{"type":"string","enum":["read","merge","replace","strip","keep"],"description":"read (default when nothing else is asked): list every tag. merge (default when something is asked): apply remove / remove_groups / set / clean and keep the rest. replace: remove everything, then write the tags in `set`. keep: return the file as it is, as a new result (so a request with several files returns every one of them). strip: remove everything (the file keeps looking and opening exactly as before).","x-davix-h2i-enum":"Mode","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown mode -> 400 invalid_parameter. read cannot be combined with changes; strip cannot be combined with remove, remove_groups, set or a partial clean.","evidence":"src/processing/metadata/request.js"}},"clean":{"type":"string","enum":["all","location","personal"],"description":"A ready-made removal: all (= mode=strip), location (GPS position and place names) or personal (location, author and owner names, serial numbers, software, company, document ids).","x-davix-h2i-enum":"Clean","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"remove":{"type":"array","items":{"type":"string"},"description":"Tags to remove: a JSON array or a comma-separated list of names as listed by a read, e.g. [\"EXIF:Artist\", \"GPS:GPSLatitude\"] (a name without a group matches in every group; * works as a wildcard).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 200 entries or a malformed name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"remove_groups":{"type":"array","items":{"type":"string"},"description":"Whole groups of tags to remove, e.g. [\"GPS\", \"XMP\", \"IPTC\"] (documents: Core, Extended, Custom, Thumbnail, Revisions).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 200 entries or a malformed group name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"set":{"type":"object","description":"Tags to write, as { \"Group:Tag\": \"value\" } (e.g. {\"EXIF:Artist\": \"Jane\"}; documents: {\"Title\": \"Report\", \"Custom:Project\": \"X-9\"}). A tag the format cannot hold is reported in `report.warnings`.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A non-object, nested values, more than 200 entries, a value over 4000 characters or a malformed name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"includeRawExif":{"type":"boolean","description":"Include the raw EXIF object.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:readMetadata"}},"normalizeOrientation":{"type":"boolean","description":"Report width/height as displayed after applying EXIF orientation.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:readMetadata"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string","nullable":true},"metadata":{"type":"object","properties":{"format":{"type":"string","nullable":true},"mimeType":{"type":"string","nullable":true},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"sizeBytes":{"type":"integer"},"exif":{"type":"object","nullable":true},"rawExif":{"type":"object","nullable":true},"icc":{"type":"boolean"},"iccProfile":{"type":"object","nullable":true},"orientation":{"type":"integer","nullable":true},"originalOrientation":{"type":"integer","nullable":true},"isAnimated":{"type":"boolean"},"animation":{"type":"object","nullable":true},"aspectRatio":{"type":"number","nullable":true},"orientationClass":{"type":"string","nullable":true},"needsRotation":{"type":"boolean"},"suggestedRotation":{"type":"integer","nullable":true}},"required":["sizeBytes","icc","isAnimated","needsRotation"],"additionalProperties":true},"writable":{"type":"boolean","description":"Whether this format can be changed (false = read only)."},"tags":{"type":"array","items":{"$ref":"#/components/schemas/MetadataTag"},"description":"Every tag of the file."},"total":{"type":"integer"},"editableCount":{"type":"integer"},"groups":{"type":"array","items":{"type":"object"},"description":"Tag groups with their counts: { name, count }."},"risks":{"type":"object","additionalProperties":true,"description":"What the tags can reveal: location, personal, device, identifier, thumbnail, dates."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["metadata"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]},{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/MetadataEditResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}],"description":"Read (nothing asked) -> results with the metadata and every tag; change -> results with the new image and a report."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.metadata","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/metadata\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'mode=read' \\\n  -F 'clean=all' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.metadata({\n    \"images\": 'photo.jpg',\n    \"mode\": \"read\",\n    \"clean\": \"all\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->metadata([\n    'images' => 'photo.jpg',\n    'mode' => 'read',\n    'clean' => 'all',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/images/mockup":{"post":{"operationId":"images.mockup","summary":"Device mockup","description":"Put a screenshot into a phone, tablet, laptop, browser window or desktop monitor, on a colour, a gradient or a transparent background, with a soft shadow.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The screenshot(s) to show on the screen.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"device":{"type":"string","enum":["phone","tablet","laptop","browser","monitor"],"default":"phone","description":"phone (default), tablet, laptop, browser or monitor.","x-davix-h2i-enum":"ImagesDevice","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"frame":{"type":"string","format":"color","default":"black","example":"silver","description":"The colour of the device: black (default), space-gray, silver, white, or a hex colour. For browser it colours the title bar. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"background":{"type":"string","format":"color","default":"#f1f5f9","example":"#dbeafe,#fce7f3","description":"A hex colour (default #f1f5f9), two hex colours separated by a comma for a gradient (#dbeafe,#fce7f3), or transparent. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"width":{"type":"integer","minimum":300,"maximum":4000,"default":1600,"description":"The width of the finished picture in pixels, 300 to 4000 (default 1600).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"padding":{"type":"number","minimum":0,"maximum":40,"default":8,"description":"Space around the device, in percent of its width (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"shadow":{"type":"boolean","default":true,"description":"true (default): a soft shadow under the device.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"fit":{"type":"string","enum":["cover","contain"],"default":"cover","description":"cover (default) fills the screen and cuts what does not fit at the bottom; contain shows the whole screenshot.","x-davix-h2i-enum":"Fit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"landscape":{"type":"boolean","default":false,"description":"For phone and tablet: lay the device on its side. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"address":{"type":"string","example":"example.com","description":"For browser: the address shown in the address bar (up to 80 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mockup.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, originalName, device }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"device":{"type":"string","enum":["phone","tablet","laptop","browser","monitor"]}},"required":["url","format","sizeBytes","width","height","device"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.mockup","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/mockup\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'device=phone' \\\n  -F 'frame=silver' \\\n  -F 'background=#dbeafe,#fce7f3'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.mockup({\n    \"images\": 'photo.jpg',\n    \"device\": \"phone\",\n    \"frame\": \"silver\",\n    \"background\": \"#dbeafe,#fce7f3\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->mockup([\n    'images' => 'photo.jpg',\n    'device' => 'phone',\n    'frame' => 'silver',\n    'background' => '#dbeafe,#fce7f3',\n]);\necho $result->requestId;"}]}},"/v1/images/mrz":{"post":{"operationId":"images.mrz","summary":"Read passport or ID line (MRZ)","description":"Read the machine-readable zone of a passport, ID card or visa from a picture (or from the text of its lines): the holder, the numbers, the dates, and every ICAO check digit verified.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"A picture of the passport page or ID card. Not needed when text is given.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"text":{"type":"string","example":"P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<\nL898902C36UTO7408122F1204159ZE184226B<<<<<10","description":"The MRZ lines as text (two or three lines), instead of a picture. Handy to check lines that another reader produced.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mrz.js"}},"type":{"type":"string","enum":["auto","td1","td2","td3"],"default":"auto","description":"The kind of zone: auto (default), td1 (ID card, 3 lines of 30), td2 (2 lines of 36) or td3 (passport, 2 lines of 44).","x-davix-h2i-enum":"ImagesMrzType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mrz.js"}},"region":{"type":"number","minimum":0.1,"maximum":1,"default":0.4,"description":"The part of the picture, from the bottom, that holds the zone, 0.1 to 1 (default 0.4 = the bottom 40%).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mrz.js"}},"scale":{"type":"number","minimum":1,"maximum":4,"default":2,"description":"How much the zone is enlarged before it is read, 1 to 4 (default 2). Raise it for small pictures.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mrz.js"}},"verify":{"type":"boolean","default":true,"description":"true (default): check every check digit and report the result. false: leave the checks out of the answer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mrz.js"}},"dates":{"type":"string","enum":["iso","raw"],"default":"iso","description":"iso (default: 1974-08-12) or raw (as printed: 740812).","x-davix-h2i-enum":"ImagesDates","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mrz.js"}},"strict":{"type":"boolean","default":false,"description":"true: refuse the answer (400) when a check digit does not match, instead of reporting it. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mrz.js"}},"expiry_pivot":{"type":"integer","minimum":0,"maximum":99,"default":70,"description":"Expiry years from this two-digit year up are read as 19xx, below it as 20xx (default 70).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/mrz.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ originalName?, found, source, message?, rawText?, type, documentType, documentCode, issuingCountry, surname, givenNames, documentNumber, nationality, birthDate, sex, expiryDate, optionalData, expired, checks, valid, lines }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string"},"found":{"type":"boolean"},"source":{"type":"string","enum":["image","text"]},"message":{"type":"string"},"rawText":{"type":"string","description":"What was read from the picture, when no zone was found (to help find the cause)."},"type":{"type":"string","enum":["td1","td2","td3"]},"documentType":{"type":"string"},"documentCode":{"type":"string"},"issuingCountry":{"type":"string"},"surname":{"type":"string"},"givenNames":{"type":"string"},"documentNumber":{"type":"string"},"nationality":{"type":"string"},"birthDate":{"type":"string","nullable":true},"sex":{"type":"string","nullable":true},"expiryDate":{"type":"string","nullable":true},"optionalData":{"type":"string","nullable":true},"expired":{"type":"boolean","nullable":true},"checks":{"type":"object","description":"documentNumber, birthDate, expiryDate, personalNumber (TD3) and composite: true when the check digit matches."},"valid":{"type":"boolean","description":"true when every check digit matches."},"lines":{"type":"array","items":{"type":"string"}}},"required":["found","source"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":0,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.mrz","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/mrz\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text=P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<\nL898902C36UTO7408122F1204159ZE184226B<<<<<10' \\\n  -F 'type=auto' \\\n  -F 'region=0.4'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.mrz({\n    \"text\": \"P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<\\nL898902C36UTO7408122F1204159ZE184226B<<<<<10\",\n    \"type\": \"auto\",\n    \"region\": 0.4\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->mrz([\n    'text' => 'P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<\nL898902C36UTO7408122F1204159ZE184226B<<<<<10',\n    'type' => 'auto',\n    'region' => 0.4,\n]);\necho $result->requestId;"}]}},"/v1/images/ocr":{"post":{"operationId":"images.ocr","summary":"OCR an image to text","description":"OCR an image to text","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Exactly one image.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"languages":{"type":"string","pattern":"^[A-Za-z_]{2,12}(\\+[A-Za-z_]{2,12}){0,3}$","default":"eng","description":"1-4 OCR language codes joined by \"+\", e.g. \"eng+deu\". Must be installed on the server (see GET /v1/capabilities for installed languages).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Bad syntax or a language pack that is not installed -> 400 (details.allowed lists the installed ones).","evidence":"src/processing/images/ocr-engine.js:resolveLanguages"}},"deskew":{"type":"boolean","description":"Straighten the image before OCR.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/api/images/ocr.js"}},"denoise":{"type":"boolean","description":"Denoise before OCR.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/api/images/ocr.js"}},"clean":{"type":"boolean","description":"Apply cleanup preprocessing.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/api/images/ocr.js"}},"output":{"type":"string","enum":["text","pdf","json","tsv","hocr","alto","csv","xlsx"],"default":"text","description":"text = the recognised text; pdf = also a searchable PDF; json = every word with confidence and box (`words`); tsv / hocr / alto = the engine layout formats as a file. csv / xlsx = the tables found in the picture as a spreadsheet file (csv: the first table; xlsx: one sheet per table).","x-davix-h2i-enum":"ImagesOcrOutput","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/images/ocr.js"}},"psm":{"type":"integer","minimum":0,"maximum":13,"default":3,"description":"OCR page segmentation mode (1 and 3-13). 0 and 2 only detect the page orientation and read no text, so they are refused.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [0,13], and 0 or 2, -> 400 invalid_parameter.","evidence":"src/processing/images/ocr-engine.js:ocrImageBuffer"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"tables":{"type":"boolean","default":false,"description":"true = also detect tables: the recognised words are grouped into rows and columns by their positions and returned as `tables` (each with its rows, a confidence and its box). Implied by output=csv|xlsx. Works for tables whose columns are separated by gaps; ruled grids without gaps and merged cells are not detected.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/api/images/ocr.js"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"confidence":{"type":"number","nullable":true},"wordCount":{"type":"integer"},"languages":{},"skewDegrees":{"type":"number","nullable":true},"url":{"type":"string","format":"uri","description":"Only with output=pdf: the searchable PDF."},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"words":{"type":"array","items":{"type":"object"},"description":"Only with output=json: every word with text, confidence, left, top, width, height, block, paragraph and line."},"format":{"type":"string","description":"The file format of `url` for tsv / hocr / alto / csv / xlsx output."},"tables":{"type":"array","items":{"type":"object"},"description":"Only with tables=true or output=csv|xlsx: the tables found (index, rows, rowCount, columnCount, confidence, box, headerRow)."},"warnings":{"type":"array","items":{"type":"string"},"description":"Notes, for example that no table was found."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["text","wordCount","languages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.ocr","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","ocr_max_languages","allow_ocr_extended_languages","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/ocr\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'output=text' \\\n  -F 'psm=3' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.ocr({\n    \"images\": 'photo.jpg',\n    \"output\": \"text\",\n    \"psm\": 3,\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->ocr([\n    'images' => 'photo.jpg',\n    'output' => 'text',\n    'psm' => 3,\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/images/optimize":{"post":{"operationId":"images.optimize","summary":"Re-encode an image for size/format","description":"Re-encode an image for size/format","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s) to re-encode.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"format":{"type":"string","enum":["jpeg","png","webp","avif","gif","tiff"],"description":"Output format. \"jpg\" is accepted as an alias of jpeg. Omitted = keep the source format.","x-davix-h2i-enum":"ImageFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased; jpg -> jpeg","note":"svg and unknown formats -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:normalizeFormat"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Encoder quality.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1,100] or non-integer -> 400. Not used for png/gif.","evidence":"src/processing/images/engine.js:applyOptimize"}},"targetSizeKB":{"type":"integer","minimum":1,"description":"Try to reach this size (KB) via quality search (7 iterations over quality 20-90).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number >= 1. Empty or 0 disables it; a non-numeric or negative value -> 400 invalid_parameter. Not supported for png output -> 400. The result may exceed the target; the chosen quality is returned.","evidence":"src/processing/images/engine.js:applyOptimize; src/shared/param-validation.js"}},"colorSpace":{"type":"string","enum":["srgb","grayscale","cmyk"],"default":"srgb","description":"Output color space.","x-davix-h2i-enum":"ColorSpace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"cmyk fails with 400 when the build does not support it.","evidence":"src/processing/images/engine.js:applyOptimize"}},"keepMetadata":{"type":"boolean","description":"Keep EXIF/ICC metadata.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:applyOptimize"}},"progressive":{"type":"boolean","description":"Progressive encoding (jpeg/png).","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:applyOptimize"}},"effort":{"type":"integer","description":"Encoder effort. The valid range depends on the output format: webp 0-6, avif 0-9, gif 1-10, png 1-10. Ignored for jpeg/tiff.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Out of range for the resolved output format -> 400 (range is per format, see description).","evidence":"src/processing/images/engine.js:validateEffort"}},"chromaSubsampling":{"type":"string","enum":["4:4:4","4:2:0"],"description":"JPEG chroma subsampling.","x-davix-h2i-enum":"ImagesChromaSubsampling","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/engine.js:validateChromaSubsampling"}},"lossless":{"type":"boolean","description":"Lossless encoding (webp/avif).","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:applyOptimize"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"maxWidth":{"type":"integer","minimum":1,"maximum":100000,"description":"Shrink the picture to at most this width before encoding (never enlarges; the proportions are kept).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100000 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyOptimize"}},"maxHeight":{"type":"integer","minimum":1,"maximum":100000,"description":"Shrink the picture to at most this height before encoding (never enlarges; the proportions are kept).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100000 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyOptimize"}},"palette":{"type":"boolean","description":"PNG only: write an indexed-colour (palette) PNG. Much smaller for flat artwork; `quality` steers how carefully colours are matched.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (or \"false\" where it is on by default) changes it","evidence":"src/processing/images/engine.js:applyOptimize"}},"paletteColours":{"type":"integer","minimum":2,"maximum":256,"description":"PNG only: palette size (2-256). Implies palette=true.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 2-256 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyOptimize"}},"bitdepth":{"type":"integer","minimum":1,"maximum":16,"description":"PNG only: bits per channel: 1, 2 or 4 (needs, and implies, a palette), 8, or 16 (not with a palette).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-16 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyOptimize"}},"animated":{"type":"boolean","default":true,"description":"false = keep only the first frame of an animated GIF/WebP; true (default) keeps the animation where the output format can hold it.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (or \"false\" where it is on by default) changes it","evidence":"src/processing/images/engine.js:applyOptimize"}},"mozjpeg":{"type":"boolean","default":true,"description":"JPEG only: false = use the standard libjpeg encoder instead of mozjpeg (faster, larger files). Default true.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (or \"false\" where it is on by default) changes it","evidence":"src/processing/images/engine.js:applyOptimize"}},"smartSubsample":{"type":"boolean","description":"WebP only: higher-quality chroma subsampling (sharper colour edges, slightly larger files).","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (or \"false\" where it is on by default) changes it","evidence":"src/processing/images/engine.js:applyOptimize"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ImageResult"}],"type":"object","properties":{"quality":{"type":"integer","nullable":true}}}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.optimize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/optimize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'format=jpeg' \\\n  -F 'quality=1' \\\n  -F 'targetSizeKB=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.optimize({\n    \"images\": 'photo.jpg',\n    \"format\": \"jpeg\",\n    \"quality\": 1,\n    \"targetSizeKB\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->optimize([\n    'images' => 'photo.jpg',\n    'format' => 'jpeg',\n    'quality' => 1,\n    'targetSizeKB' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/palette":{"post":{"operationId":"images.palette","summary":"Color palette","description":"Find the main colours of a picture: each with its share of the picture, hex, RGB and HSL values, the nearest colour name and a text colour that reads on it. Optionally a PNG strip of the swatches.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to read the colours of.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"colors":{"type":"integer","minimum":1,"maximum":16,"default":6,"description":"How many colours to find, 1 to 16 (default 6).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/palette.js"}},"swatch":{"type":"boolean","default":false,"description":"true: also make a PNG strip with one square per colour (`swatchUrl`). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/palette.js"}},"ignore_white":{"type":"boolean","default":false,"description":"true: leave out white (a plain white background). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/palette.js"}},"ignore_black":{"type":"boolean","default":false,"description":"true: leave out black. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/palette.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ originalName, colors: [{ hex, rgb, hsl, percent, name, textColor }], average, dark, transparentPercent, width, height, swatchUrl? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string"},"colors":{"type":"array","items":{"type":"object"},"description":"Most used first: hex, rgb { r, g, b }, hsl { h, s, l }, percent (share of the picture), name (the nearest CSS colour name) and textColor (#000000 or #ffffff, whichever reads on it)."},"average":{"type":"object","description":"The average colour: { hex, rgb }."},"dark":{"type":"boolean","description":"true when the picture as a whole is dark."},"transparentPercent":{"type":"number"},"width":{"type":"integer"},"height":{"type":"integer"},"swatchUrl":{"type":"string","format":"uri","description":"The swatch strip (swatch=true)."},"swatchBytes":{"type":"integer"}},"required":["colors","average","dark","transparentPercent","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.palette","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/palette\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'colors=6' \\\n  -F 'swatch=false' \\\n  -F 'ignore_white=false'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.palette({\n    \"images\": 'photo.jpg',\n    \"colors\": 6,\n    \"swatch\": false,\n    \"ignore_white\": false\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->palette([\n    'images' => 'photo.jpg',\n    'colors' => 6,\n    'swatch' => false,\n    'ignore_white' => false,\n]);\necho $result->requestId;"}]}},"/v1/images/parse-code":{"post":{"operationId":"images.parse-code","summary":"Parse code content","description":"Say what the text of a QR code or barcode means (Wi-Fi login, contact, event, link, phone, message, place, e-mail, payment, one-time-password setup, product number ...), from `content` or from the code in a picture.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"A picture with one or more QR codes or barcodes. Not needed when content is given.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"content":{"type":"string","example":"WIFI:T:WPA;S:Cafe;P:secret;;","description":"The text of a code, instead of (or as well as) a picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/parse-code.js"}},"formats":{"type":"array","items":{"type":"string"},"description":"Only read these symbologies in a picture (default: all), as a list or comma-separated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/parse-code.js"}},"include_raw":{"type":"boolean","default":true,"description":"true (default): include the text of the code in every result (content).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/parse-code.js"}},"validate":{"type":"boolean","default":true,"description":"true (default): check the content (a check digit, a valid address, a required field) and give `valid`.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/parse-code.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"formats":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ count, results: [{ source, originalName?, found?, format?, content?, kind, label, fields, valid?, warnings? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["content","image"]},"originalName":{"type":"string"},"found":{"type":"boolean"},"format":{"type":"string"},"content":{"type":"string"},"kind":{"type":"string","enum":["wifi","contact","event","email","phone","sms","location","otp","payment","bank-account","url","product","text"],"description":"What the code is."},"label":{"type":"string"},"fields":{"type":"object","description":"The parts of the content, depending on kind (for a Wi-Fi code: ssid, password, security, hidden)."},"valid":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["source"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["count","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":0,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.parse-code","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/parse-code\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'content=WIFI:T:WPA;S:Cafe;P:secret;;' \\\n  -F 'formats=[\"example\"]' \\\n  -F 'include_raw=true'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.parseCode({\n    \"content\": \"WIFI:T:WPA;S:Cafe;P:secret;;\",\n    \"formats\": [\n      \"example\"\n    ],\n    \"include_raw\": true\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->parseCode([\n    'content' => 'WIFI:T:WPA;S:Cafe;P:secret;;',\n    'formats' => ['example'],\n    'include_raw' => true,\n]);\necho $result->requestId;"}]}},"/v1/images/passport-photo":{"post":{"operationId":"images.passport-photo","summary":"Passport photo","description":"Cut a portrait to the size and shape of an ID photo for a country (or your own size), at print resolution, on the background colour needed, and lay several copies on a print sheet. The face is not detected: you set the zoom and position.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The portrait photo(s).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"country":{"type":"string","default":"us","description":"The standard: us (default), india, canada, china, eu, uk, japan, australia, korea, russia, brazil, uae, saudi, turkey, south-africa, nigeria. Ignored when width_mm and height_mm are given.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"width_mm":{"type":"number","minimum":10,"maximum":200,"description":"A photo width in millimetres of your own (goes with height_mm).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"height_mm":{"type":"number","minimum":10,"maximum":300,"description":"A photo height in millimetres of your own (goes with width_mm).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"dpi":{"type":"number","minimum":72,"maximum":1200,"default":300,"description":"Print resolution (default 300).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"The background colour as a hex colour (default #ffffff). Fills transparent areas and, with replace_background, the old background. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"replace_background":{"type":"boolean","default":false,"description":"true: replace a plain background (one colour) with `background`. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"tolerance":{"type":"number","minimum":0,"maximum":100,"default":14,"description":"With replace_background: how different from the old background colour a pixel may be, 0 to 100 (default 14).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"zoom":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"How far to zoom in, 1 to 4 (default 1 = the largest crop that fits). Raise it until the head fills the frame as the standard asks.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"offset_x":{"type":"number","minimum":-1,"maximum":1,"default":0,"description":"Move the crop left (-1) or right (1), default 0.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"offset_y":{"type":"number","minimum":-1,"maximum":1,"default":0,"description":"Move the crop up (-1) or down (1), default 0.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"rotate":{"type":"number","minimum":-45,"maximum":45,"default":0,"description":"Turn the photo before cutting, in degrees, -45 to 45 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"guides":{"type":"boolean","default":false,"description":"true: draw a head-and-shoulders outline and centre lines on the result, to check the placement. Do not print it. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"sheet":{"type":"string","enum":["none","4x6","5x7","a4","letter","a6"],"default":"none","description":"Lay copies on a print sheet: none (default), 4x6, 5x7, a4, letter or a6.","x-davix-h2i-enum":"ImagesSheet","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"copies":{"type":"integer","minimum":1,"maximum":60,"description":"How many copies on the sheet (default: as many as fit).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"gap_mm":{"type":"number","minimum":0,"maximum":20,"default":2,"description":"Space between the copies in millimetres (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"cut_lines":{"type":"boolean","default":true,"description":"true (default): draw a thin cutting line around each copy.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"sheet_background":{"type":"string","format":"color","default":"#ffffff","description":"The colour of the sheet paper (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/passport-photo.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, originalName, standard, widthMm, heightMm, dpi, sheet?, copies?, columns?, rows? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"standard":{"type":"string","description":"The standard used, for example \"European Union and Schengen (35 x 45 mm)\"."},"widthMm":{"type":"number"},"heightMm":{"type":"number"},"dpi":{"type":"integer"},"sheet":{"type":"string"},"copies":{"type":"integer"},"columns":{"type":"integer"},"rows":{"type":"integer"}},"required":["url","format","sizeBytes","width","height","standard","widthMm","heightMm","dpi"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.passport-photo","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/passport-photo\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'width_mm=10' \\\n  -F 'height_mm=10' \\\n  -F 'dpi=300'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.passportPhoto({\n    \"images\": 'photo.jpg',\n    \"width_mm\": 10,\n    \"height_mm\": 10,\n    \"dpi\": 300\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->passportPhoto([\n    'images' => 'photo.jpg',\n    'width_mm' => 10,\n    'height_mm' => 10,\n    'dpi' => 300,\n]);\necho $result->requestId;"}]}},"/v1/images/pdf":{"post":{"operationId":"images.pdf","summary":"Convert image(s) to a PDF","description":"Convert image(s) to a PDF","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image(s) to convert.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"mode":{"type":"string","enum":["perImage","combined"],"default":"perImage","description":"perImage = one PDF per image; combined = one PDF.","x-davix-h2i-enum":"ImagesPdfMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/images/pdf.js"}},"pageSize":{"type":"string","enum":["a4","letter","auto"],"default":"auto","description":"Page size; auto fits the image.","x-davix-h2i-enum":"ImagesPageSize","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:validatePdfImageParams"}},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation (a4/letter).","x-davix-h2i-enum":"Orientation2","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:validatePdfImageParams"}},"margin":{"type":"number","minimum":0,"maximum":5000,"default":0,"description":"Page margin (points).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","evidence":"src/processing/images/engine.js:validatePdfImageParams"}},"embedFormat":{"type":"string","enum":["jpeg","jpg","png"],"default":"png","description":"Raster format embedded in the PDF (\"jpg\" = jpeg).","x-davix-h2i-enum":"ImagesEmbedFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:validatePdfImageParams"}},"embedQuality":{"type":"integer","minimum":20,"maximum":100,"default":85,"description":"JPEG embed quality.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number from 20 to 100; anything else -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:toPdfEmbeddableBuffer; src/shared/param-validation.js"}},"imageOptions":{"type":"array","items":{"type":"object","properties":{"pageSize":{"type":"string","enum":["a4","letter","auto"],"x-davix-h2i-enum":"ImagesPageSize"},"orientation":{"type":"string","enum":["portrait","landscape"],"x-davix-h2i-enum":"Orientation2"},"embedFormat":{"type":"string","enum":["jpeg","jpg","png"],"x-davix-h2i-enum":"ImagesEmbedFormat"},"embedQuality":{"type":"integer","minimum":20,"maximum":100},"margin":{"type":"number","minimum":0,"maximum":5000}}},"description":"Per-image overrides (JSON array, one entry per uploaded image; not more entries than images).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/images/pdf.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"imageOptions":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["pdf"]},"sizeBytes":{"type":"integer"},"originalName":{"type":"string","nullable":true}},"required":["url","format","sizeBytes"]}},"url":{"type":"string","format":"uri","description":"mode=combined only: the single result is also repeated at the top level (backward compatibility)."},"format":{"type":"string","enum":["pdf"]},"sizeBytes":{"type":"integer"},"originalName":{"type":"string","nullable":true},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":true,"outputParam":{"name":"mode","separate":"perImage","combined":"combined","default":"separate"}},"x-davix-h2i-id":"images.pdf","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/pdf\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'mode=perImage' \\\n  -F 'pageSize=auto' \\\n  -F 'orientation=portrait'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.pdf({\n    \"images\": 'photo.jpg',\n    \"mode\": \"perImage\",\n    \"pageSize\": \"auto\",\n    \"orientation\": \"portrait\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->pdf([\n    'images' => 'photo.jpg',\n    'mode' => 'perImage',\n    'pageSize' => 'auto',\n    'orientation' => 'portrait',\n]);\necho $result->requestId;"}]}},"/v1/images/pipeline":{"post":{"operationId":"images.pipeline","summary":"Run an ordered chain of image operations","description":"Run an ordered chain of image operations","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Exactly one input image.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operations":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","properties":{"op":{"type":"string","enum":["autoOrient","crop","resize","rotate","flip","enhance","background","padding","border","watermark","optimize","trim","colorSpace","convolve","affine","channelExtract","noise","vignette","pixelate","posterize","duotone","emboss","edgeDetect","tile","slice","grid","contactSheet","spriteSheet"],"description":"Operation name. slice/grid/contactSheet/spriteSheet are listed only so that using them returns an actionable 400 (use their dedicated endpoints).","x-davix-h2i-enum":"ImagesOp","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/engine.js:validatePipelineOperations"}}},"required":["op"],"additionalProperties":true},"description":"Ordered operations (JSON array, max 50). Each item is {op, ...params}; see `actions` for the parameters of each op. Can be supplied by a preset (presetId).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Empty (without a preset supplying them) or > 50 operations -> 400. `optimize` must be last; `autoOrient` at most once; errors carry operationIndex.","evidence":"src/processing/images/engine.js:validatePipelineOperations"}},"watermarkImage":{"type":"string","format":"binary","description":"Overlay image used by any `watermark` operation (one file).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"operations":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ImageResult"}],"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"}}}}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-actions":{"selector":"operations[].op","style":"operations-list","items":[{"name":"autoOrient","description":"Apply EXIF orientation (at most once).","fields":[]},{"name":"crop","fields":["x","y","width","height"],"requiredFields":["x","y","width","height"],"evidence":"src/processing/images/engine.js:validatePipelineOperations"},{"name":"resize","description":"Requires width and/or height. NOTE: the pipeline op uses `fit`, while /v1/images/resize calls it `resizeMode`.","fields":["width","height","fit","enlarge","gravity"],"evidence":"src/processing/images/engine.js:validatePipelineOperations"},{"name":"rotate","fields":["angle"],"requiredFields":["angle"]},{"name":"flip","fields":["axis"]},{"name":"enhance","fields":["blur","sharpen","grayscale","sepia","brightness","saturation","contrast","hue","gamma","threshold","tint","negate","median","clahe","exposure"]},{"name":"background","fields":["color","blur"]},{"name":"padding","fields":["top","right","bottom","left","all","color"]},{"name":"border","fields":["width","color","radius"],"requiredFields":["width"]},{"name":"watermark","fields":["text","position","opacity","margin","scale","fontSize","color","tile","tileSpacing"]},{"name":"optimize","description":"Must be the last operation.","fields":["format","quality","targetSizeKB","colorSpace","keepMetadata","progressive","effort","chromaSubsampling","lossless"]},{"name":"trim","fields":["trim","trimThreshold"]},{"name":"colorSpace","fields":["value"],"requiredFields":["value"]},{"name":"convolve","fields":["convolve"]},{"name":"affine","fields":["affine"]},{"name":"channelExtract","fields":["channelExtract"]},{"name":"noise","fields":["amount"]},{"name":"vignette","fields":["intensity","color"]},{"name":"pixelate","fields":["pixelSize"]},{"name":"posterize","fields":["levels"]},{"name":"duotone","fields":["shadowColor","highlightColor"]},{"name":"emboss","fields":[]},{"name":"edgeDetect","fields":[]},{"name":"tile","fields":["cols","rows"]},{"name":"slice","description":"Not usable in a pipeline (multi-output); returns 400. Use POST /v1/images/slice.","fields":[]},{"name":"grid","description":"Not usable in a pipeline (multi-input); returns 400. Use POST /v1/images/grid.","fields":[]},{"name":"contactSheet","description":"Not usable in a pipeline; use POST /v1/images/contact-sheet.","fields":[]},{"name":"spriteSheet","description":"Not usable in a pipeline; use POST /v1/images/sprite-sheet.","fields":[]}]},"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.pipeline","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","max_output_dimension_px","max_output_pixels","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/pipeline\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'operations=[{\"op\":\"autoOrient\"}]' \\\n  -F 'output_bundle=zip' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.pipeline({\n    \"images\": 'photo.jpg',\n    \"operations\": [\n      {\n        \"op\": \"autoOrient\"\n      }\n    ],\n    \"output_bundle\": \"zip\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->pipeline([\n    'images' => 'photo.jpg',\n    'operations' => [[\n            'op' => 'autoOrient',\n        ]],\n    'output_bundle' => 'zip',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/images/placeholder":{"post":{"operationId":"images.placeholder","summary":"Placeholder","description":"Make a plain picture of a given size for a layout, a test or a mock-up: a colour, optional text (the size by default) and an optional pattern, as PNG, JPEG, WebP, AVIF or SVG.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"width":{"type":"integer","minimum":1,"maximum":10000,"example":800,"description":"The width in pixels, 1 to 10000.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/placeholder.js"}},"height":{"type":"integer","minimum":1,"maximum":10000,"example":600,"description":"The height in pixels, 1 to 10000 (at most 40 megapixels in all).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/placeholder.js"}},"background":{"type":"string","format":"color","default":"#cccccc","description":"The background as a hex colour (default #cccccc). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/placeholder.js"}},"color":{"type":"string","format":"color","description":"The text and pattern colour as a hex colour. Not given: dark or light, whichever reads on the background. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/placeholder.js"}},"text":{"type":"string","example":"Hero image","description":"The text in the middle, up to 200 characters and 6 lines. Default: the size, such as \"800 × 600\". A single space shows no text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/placeholder.js"}},"pattern":{"type":"string","enum":["none","grid","diagonal","cross"],"default":"none","description":"none (default), grid, diagonal or cross (the crossed box of a classic placeholder).","x-davix-h2i-enum":"ImagesPattern","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/placeholder.js"}},"file_type":{"type":"string","enum":["png","jpeg","webp","avif","svg"],"default":"png","description":"The format: png (default), jpeg, webp, avif or svg.","x-davix-h2i-enum":"ImagesPictureFileType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/placeholder.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"default":85,"description":"Quality of jpeg, webp and avif, 1 to 100 (default 85).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/placeholder.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["width","height"]}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["png","jpeg","webp","avif","svg"]},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"}},"required":["url","format","sizeBytes","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"images.placeholder","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/placeholder\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'width=800' \\\n  -F 'height=600' \\\n  -F 'text=Hero image'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.placeholder({\n    \"width\": 800,\n    \"height\": 600,\n    \"text\": \"Hero image\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->placeholder([\n    'width' => 800,\n    'height' => 600,\n    'text' => 'Hero image',\n]);\necho $result->requestId;"}]}},"/v1/images/poster-tiles":{"post":{"operationId":"images.poster-tiles","summary":"Poster tiling","description":"Cut a big picture into page-size tiles to print and stick together into a poster, with an overlap to glue, crop marks and a label on every tile, as one PDF or a ZIP of pictures.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture to turn into a poster.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"page":{"type":"string","enum":["a4","a3","a5","letter","legal","tabloid"],"default":"a4","description":"The paper: a4 (default), a3, a5, letter, legal or tabloid.","x-davix-h2i-enum":"ImagesPage","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"orientation":{"type":"string","enum":["auto","portrait","landscape"],"default":"auto","description":"auto (default: landscape pages for a wide picture), portrait or landscape.","x-davix-h2i-enum":"Orientation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"columns":{"type":"integer","minimum":1,"maximum":20,"description":"Pages across (1 to 20). With only columns, the rows follow the shape of the picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"rows":{"type":"integer","minimum":1,"maximum":20,"description":"Pages down (1 to 20). With only rows, the columns follow the shape of the picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"poster_width_cm":{"type":"number","minimum":5,"maximum":600,"description":"The finished width in cm, instead of columns (the number of pages is worked out).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"overlap_mm":{"type":"number","minimum":0,"maximum":50,"default":10,"description":"Overlap between neighbouring pages, for gluing, in mm (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"margin_mm":{"type":"number","minimum":0,"maximum":40,"default":5,"description":"The unprinted page margin in mm (default 5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"fit":{"type":"string","enum":["cover","stretch","contain"],"default":"cover","description":"cover (default: fill the poster, cut what does not fit), stretch or contain.","x-davix-h2i-enum":"ImagesPosterTilesFit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"dpi":{"type":"integer","minimum":72,"maximum":400,"default":150,"description":"Print resolution, 72 to 400 (default 150).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"marks":{"type":"boolean","default":true,"description":"true (default): crop marks and dashed overlap lines (PDF).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"labels":{"type":"boolean","default":true,"description":"true (default): a label such as A1 on every tile (PDF).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"output":{"type":"string","enum":["pdf","zip"],"default":"pdf","description":"pdf (default: one tile per page) or zip (one PNG per tile).","x-davix-h2i-enum":"Output","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"The colour of areas the picture does not cover, as a hex colour (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"title":{"type":"string","example":"Family poster","description":"The title stored in the PDF (up to 80 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/poster-tiles.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, originalName, tiles, columns, rows, page, orientation, posterWidthMm, posterHeightMm, tileNames }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["pdf","zip"]},"sizeBytes":{"type":"integer"},"originalName":{"type":"string"},"tiles":{"type":"integer"},"columns":{"type":"integer"},"rows":{"type":"integer"},"page":{"type":"string"},"orientation":{"type":"string","enum":["portrait","landscape"]},"posterWidthMm":{"type":"integer"},"posterHeightMm":{"type":"integer"},"tileNames":{"type":"array","items":{"type":"string"},"description":"The names of the tiles: the row letter and the column number (A1, A2, B1 ...)."}},"required":["url","format","sizeBytes","tiles","columns","rows","page","orientation","posterWidthMm","posterHeightMm","tileNames"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.poster-tiles","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/poster-tiles\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'page=a4' \\\n  -F 'orientation=auto' \\\n  -F 'columns=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.posterTiles({\n    \"images\": 'photo.jpg',\n    \"page\": \"a4\",\n    \"orientation\": \"auto\",\n    \"columns\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->posterTiles([\n    'images' => 'photo.jpg',\n    'page' => 'a4',\n    'orientation' => 'auto',\n    'columns' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/profile-picture":{"post":{"operationId":"images.profile-picture","summary":"Profile picture maker","description":"Turn a photo into a profile picture: cropped around the face (you choose the centre and the zoom), cut into a circle, rounded square, squircle, hexagon or square, with a ring of one or two colours, a backdrop, a soft shadow and touch-ups (black and white, brightness, contrast, saturation).","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The photo(s) to turn into a profile picture.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"shape":{"type":"string","enum":["circle","rounded","squircle","square","hexagon"],"default":"circle","description":"circle, rounded, squircle, square, hexagon (default circle).","x-davix-h2i-enum":"ImagesProfilePictureShape","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"size":{"type":"integer","minimum":32,"maximum":2048,"default":512,"description":"The width and height in pixels, 32 to 2048 (default 512).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"corner_radius":{"type":"number","minimum":0,"maximum":50,"default":22,"description":"rounded: the corner radius as a percentage of the size, 0 to 50 (default 22).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"zoom":{"type":"number","minimum":1,"maximum":4,"default":1,"description":"Zoom in on the photo, 1 to 4 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"offset_x":{"type":"number","minimum":-1,"maximum":1,"default":0,"description":"Move the crop sideways, -1 (left) to 1 (right) (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"offset_y":{"type":"number","minimum":-1,"maximum":1,"default":0,"description":"Move the crop up or down, -1 (top) to 1 (bottom) (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"mirror":{"type":"boolean","default":false,"description":"true: flip the photo left to right. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"ring_width":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"A ring around the picture as a percentage of the size, 0 to 100 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"ring_color":{"type":"string","format":"color","default":"#ffffff","example":"#ff0066","description":"The ring as a hex colour (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"ring_color2":{"type":"string","example":"#ffcc00","description":"A second colour: the ring becomes a gradient.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"backdrop":{"type":"string","format":"color","default":"transparent","example":"#112233","description":"The colour behind the shape as a hex colour, or transparent (default transparent). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"shadow":{"type":"boolean","default":false,"description":"true: a soft shadow under the picture. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"grayscale":{"type":"boolean","default":false,"description":"true: black and white. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"brightness":{"type":"number","minimum":0.2,"maximum":2,"default":1,"description":"The brightness, 0.2 to 2 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"contrast":{"type":"number","minimum":0.2,"maximum":2,"default":1,"description":"The contrast, 0.2 to 2 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"saturation":{"type":"number","minimum":0,"maximum":3,"default":1,"description":"The colour strength, 0 to 3 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"sharpen":{"type":"boolean","default":false,"description":"true: sharpen a little. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/profile-picture.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, shape, size, crop: { left, top, size }, ring, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"shape":{"type":"string"},"size":{"type":"integer"},"crop":{"type":"object","description":"left, top and size of the square cut out of the photo, in source pixels."},"ring":{"type":"integer","description":"The ring width in pixels."}},"required":["url","format","sizeBytes","width","height","shape","size","crop","ring"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.profile-picture","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/profile-picture\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'shape=circle' \\\n  -F 'size=512' \\\n  -F 'corner_radius=22'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.profilePicture({\n    \"images\": 'photo.jpg',\n    \"shape\": \"circle\",\n    \"size\": 512,\n    \"corner_radius\": 22\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->profilePicture([\n    'images' => 'photo.jpg',\n    'shape' => 'circle',\n    'size' => 512,\n    'corner_radius' => 22,\n]);\necho $result->requestId;"}]}},"/v1/images/qr":{"post":{"operationId":"images.qr","summary":"Generate a QR code","description":"A QR code for any text or URL as PNG, SVG (vector) or PDF (vector): colours, size, quiet zone, error correction and an optional centred logo. Counts as one file.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"logo":{"type":"array","items":{"type":"string","format":"binary"},"description":"An image placed in the centre of the code (up to 20% of its width). It needs error correction Q or H, which is chosen automatically when a logo is sent.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"The logo sits on a white plate; the code stays readable because of the higher error correction. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"text":{"type":"string","maxLength":2000,"description":"What the code holds: text, a URL, a Wi-Fi string, a vCard ... (up to 2000 characters, and what fits the chosen error correction).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"file_type":{"type":"string","enum":["png","svg","pdf"],"default":"png","description":"png (default), svg or pdf.","x-davix-h2i-enum":"ImagesFileType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"color":{"type":"string","format":"color","default":"#000000","description":"Foreground colour, e.g. #000000 (default). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"Background colour, e.g. #ffffff (default). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"size":{"type":"integer","minimum":64,"maximum":4096,"default":512,"description":"Width and height in pixels (PNG) or points (SVG, PDF): 64 to 4096, default 512.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"margin":{"type":"integer","minimum":0,"maximum":16,"default":4,"description":"Quiet zone around the code, in modules: 0 to 16, default 4.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"error_correction":{"type":"string","enum":["L","M","Q","H"],"default":"M","description":"L (7 %), M (15 %, default), Q (25 %) or H (30 %) of the code can be damaged and still be read. More correction makes a denser code.","x-davix-h2i-enum":"ImagesErrorCorrection","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"transparent":{"type":"boolean","default":false,"description":"Transparent background instead of `background` (PNG, SVG, PDF).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/codes.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"logo\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["text"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, version, errorCorrection, modules }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["png","svg","pdf"]},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"version":{"type":"integer"},"errorCorrection":{"type":"string","enum":["L","M","Q","H"]},"modules":{"type":"integer"}},"required":["url","format","sizeBytes","width","height","version","errorCorrection","modules"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"logo","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.qr","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/qr\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text=example' \\\n  -F 'file_type=png' \\\n  -F 'size=512'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.qr({\n    \"text\": \"example\",\n    \"file_type\": \"png\",\n    \"size\": 512\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->qr([\n    'text' => 'example',\n    'file_type' => 'png',\n    'size' => 512,\n]);\necho $result->requestId;"}]}},"/v1/images/qr-styled":{"post":{"operationId":"images.qr-styled","summary":"Styled QR code","description":"A QR code with a design of your own: dot shapes, eye shapes and colours, a gradient, a logo and a frame with a label, as PNG, JPEG, WebP or SVG.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"text":{"type":"string","example":"https://example.com","description":"What the code contains: a web address, text, a Wi-Fi login ... up to 2000 characters.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"logo":{"type":"array","items":{"type":"string","format":"binary"},"description":"An image placed in the centre of the code (up to 20% of its width). It needs error correction Q or H, which is chosen automatically when a logo is sent.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"The logo sits on a white plate; the code stays readable because of the higher error correction. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"file_type":{"type":"string","enum":["png","jpeg","webp","svg"],"default":"png","description":"png (default), jpeg, webp or svg.","x-davix-h2i-enum":"ImagesQrStyledFileType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"size":{"type":"number","minimum":100,"maximum":4000,"default":800,"description":"Width of the picture in pixels, 100 to 4000 (default 800).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"margin":{"type":"integer","minimum":0,"maximum":20,"default":4,"description":"Quiet zone around the code, in modules (default 4).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"error_correction":{"type":"string","enum":["L","M","Q","H"],"description":"L, M, Q or H. Not given: M, or H when a logo is sent.","x-davix-h2i-enum":"ImagesErrorCorrection","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"body":{"type":"string","enum":["square","rounded","dots","diamond","star"],"default":"square","description":"The shape of the dots: square (default), rounded, dots, diamond or star.","x-davix-h2i-enum":"ImagesBody","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"module_scale":{"type":"number","minimum":0.4,"maximum":1,"default":1,"description":"The size of each dot inside its cell, 0.4 to 1 (default 1). Below 1 leaves gaps between the dots.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"eye_frame":{"type":"string","enum":["square","rounded","circle","leaf"],"default":"square","description":"The outer shape of the three corner squares: square (default), rounded, circle or leaf.","x-davix-h2i-enum":"ImagesEyeFrame","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"eye_ball":{"type":"string","enum":["square","rounded","circle","diamond"],"default":"square","description":"The inner shape of the corner squares: square (default), rounded, circle or diamond.","x-davix-h2i-enum":"ImagesEyeBall","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"color":{"type":"string","format":"color","default":"#111827","description":"The colour of the dots as a hex colour (default #111827). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"color2":{"type":"string","example":"#db2777","description":"A second colour: the dots change from color to color2 (see gradient).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"gradient":{"type":"string","enum":["none","linear","radial"],"description":"none, linear or radial. Default: linear when color2 is given, otherwise none.","x-davix-h2i-enum":"ImagesQrStyledGradient","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"gradient_angle":{"type":"number","minimum":0,"maximum":360,"default":45,"description":"The direction of a linear gradient in degrees, 0 to 360 (default 45).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"eye_color":{"type":"string","format":"color","example":"#047857","description":"The colour of the corner square frames (default: the dot colour). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"eye_ball_color":{"type":"string","format":"color","example":"#047857","description":"The colour of the inner corner squares (default: eye_color). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"A hex colour (default #ffffff) or transparent (png, webp and svg). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"logo_size":{"type":"number","minimum":5,"maximum":30,"default":20,"description":"The logo width in percent of the code, 5 to 30 (default 20).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"logo_background":{"type":"string","format":"color","default":"#ffffff","description":"The colour of the plate behind the logo (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"logo_shape":{"type":"string","enum":["square","circle","rounded"],"default":"rounded","description":"The shape of the plate behind the logo: rounded (default), circle or square.","x-davix-h2i-enum":"ImagesLogoShape","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"logo_padding":{"type":"number","minimum":0,"maximum":3,"default":0.6,"description":"Space between the logo and its plate edge, in modules, 0 to 3 (default 0.6).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"knockout":{"type":"boolean","default":true,"description":"true (default): leave the dots under the logo out, so the logo is not drawn over them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"frame":{"type":"string","enum":["none","box","banner"],"default":"none","description":"none (default), box (a border) or banner (a border with a label bar below).","x-davix-h2i-enum":"ImagesQrStyledFrame","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"label":{"type":"string","example":"Scan me","description":"The text in the banner under the code, for example \"Scan me\" (up to 40 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"frame_color":{"type":"string","format":"color","example":"#1d4ed8","description":"The colour of the frame and banner (default: the dot colour). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"label_color":{"type":"string","format":"color","example":"#ffffff","description":"The colour of the label text (default: white or black, whichever reads on the banner). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/qr-styled.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"logo\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["text"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, modules, errorCorrection, contrast, warnings? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["png","jpeg","webp","svg"]},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"modules":{"type":"integer","description":"The number of modules per side of the code."},"errorCorrection":{"type":"string","enum":["L","M","Q","H"]},"contrast":{"type":"number","description":"The contrast ratio between the dots and the background (scanners need about 3 or more)."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["url","format","sizeBytes","width","height","modules","errorCorrection","contrast"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"logo","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.qr-styled","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/qr-styled\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text=https://example.com' \\\n  -F 'file_type=png' \\\n  -F 'size=800'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.qrStyled({\n    \"text\": \"https://example.com\",\n    \"file_type\": \"png\",\n    \"size\": 800\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->qrStyled([\n    'text' => 'https://example.com',\n    'file_type' => 'png',\n    'size' => 800,\n]);\necho $result->requestId;"}]}},"/v1/images/redact-text":{"post":{"operationId":"images.redact-text","summary":"Redact text in image","description":"Find text in a screenshot or a photo of a document with OCR, match your words or kinds of data (e-mail, phone, card number, IBAN, ...), and cover them with a box, a blur or a pixelation; or only list where they are.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to redact.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"terms":{"type":"array","example":"[\"John Smith\",\"Project Falcon\"]","items":{"type":"string"},"description":"Words or phrases to hide, as a list or comma-separated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"kinds":{"type":"array","example":"[\"email\",\"card\"]","items":{"type":"string"},"description":"Kinds of data to hide: email, phone, card, iban, ssn, url, ip, date, amount. Give terms, kinds or both.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"whole_word":{"type":"boolean","default":false,"description":"true: terms only match whole words. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"case_sensitive":{"type":"boolean","default":false,"description":"true: terms must match in upper and lower case. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"mode":{"type":"string","enum":["box","blur","pixelate"],"default":"box","description":"box (default: a solid cover), blur or pixelate.","x-davix-h2i-enum":"ImagesRedactTextMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"fill":{"type":"string","format":"color","default":"#000000","example":"#1a73e8","description":"The colour of the box as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"strength":{"type":"number","minimum":1,"maximum":100,"default":60,"description":"With blur or pixelate: how strong, 1 to 100 (default 60).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"padding":{"type":"integer","minimum":0,"maximum":50,"default":3,"description":"Extra pixels around every found word, 0 to 50 (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"languages":{"type":"string","default":"eng","example":"eng+deu","description":"The OCR languages, for example eng or eng+deu (default eng).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"min_confidence":{"type":"number","minimum":0,"maximum":100,"default":30,"description":"Ignore words the OCR is less sure of than this, 0 to 100 (default 30).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"report_only":{"type":"boolean","default":false,"description":"true: only list what was found and where; no picture is made. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/redact-text.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"terms":{"contentType":"application/json"},"kinds":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ width, height, wordsRead, count, found: [{ text, kind, term?, x, y, width, height, confidence }], redacted, changed, url?, format?, sizeBytes?, originalName }], count, reportOnly }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"wordsRead":{"type":"integer"},"count":{"type":"integer"},"found":{"type":"array","items":{"type":"object"},"description":"Each match: text, kind, term (for a word you gave), x, y, width, height (pixels of the upright picture) and confidence (0-100)."},"redacted":{"type":"integer"},"changed":{"type":"boolean"},"url":{"type":"string","format":"uri","description":"The redacted picture (PNG), when one was made."},"format":{"type":"string"},"sizeBytes":{"type":"integer"}},"required":["width","height","wordsRead","count","found","redacted","changed"]}},"count":{"type":"integer"},"reportOnly":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","count","reportOnly"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.redact-text","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/redact-text\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'terms=[\"John Smith\",\"Project Falcon\"]' \\\n  -F 'kinds=[\"email\",\"card\"]' \\\n  -F 'mode=box'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.redactText({\n    \"images\": 'photo.jpg',\n    \"terms\": \"[\\\"John Smith\\\",\\\"Project Falcon\\\"]\",\n    \"kinds\": \"[\\\"email\\\",\\\"card\\\"]\",\n    \"mode\": \"box\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->redactText([\n    'images' => 'photo.jpg',\n    'terms' => '[\"John Smith\",\"Project Falcon\"]',\n    'kinds' => '[\"email\",\"card\"]',\n    'mode' => 'box',\n]);\necho $result->requestId;"}]}},"/v1/images/remove-background":{"post":{"operationId":"images.remove-background","summary":"Remove a plain background","description":"Makes the background of each picture transparent when it is (nearly) one colour: product photos on white, logos, scans, green-screen shots. Local and deterministic, no model. `mode=edges` removes only background connected to the picture's border; `mode=all` removes every matching pixel (chroma key). The result is a transparent PNG by default (any format that holds transparency via `output_format`). Pictures with a busy or graded background cannot be cut out by colour: use the AI image-edit endpoint for those.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Picture(s) whose background to remove. Every file is processed with the same parameters.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"background_color":{"type":"string","format":"color","default":"auto","description":"`auto` (default) takes the colour most of the picture's border has; or give the colour to remove, e.g. `#ffffff` or `#00ff00`. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not auto, a hex colour or a basic colour name -> 400 invalid_parameter.","evidence":"src/processing/images/remove-background.js:parseOptions"}},"tolerance":{"type":"integer","minimum":0,"maximum":100,"default":12,"description":"How far a pixel may differ from the background colour and still count as background (0 = exact match, 100 = very loose).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-100 -> 400 invalid_parameter.","evidence":"src/processing/images/remove-background.js:parseOptions"}},"mode":{"type":"string","enum":["edges","all"],"default":"edges","description":"edges: remove only background connected to the border. all: remove every pixel that matches (chroma key).","x-davix-h2i-enum":"ImagesRemoveBackgroundMode","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/remove-background.js:parseOptions"}},"feather":{"type":"number","minimum":0,"maximum":20,"default":1,"description":"Softens the cut-out edge by this many pixels (0 = hard edge).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-20 -> 400 invalid_parameter.","evidence":"src/processing/images/remove-background.js:parseOptions"}},"shrink":{"type":"integer","minimum":0,"maximum":20,"default":0,"description":"Pulls the cut-out edge inward by this many pixels to remove a leftover halo of background colour.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-20 -> 400 invalid_parameter.","evidence":"src/processing/images/remove-background.js:parseOptions"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BackgroundRemovalResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.remove-background","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/remove-background\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'tolerance=12' \\\n  -F 'mode=edges' \\\n  -F 'feather=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.removeBackground({\n    \"images\": 'photo.jpg',\n    \"tolerance\": 12,\n    \"mode\": \"edges\",\n    \"feather\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->removeBackground([\n    'images' => 'photo.jpg',\n    'tolerance' => 12,\n    'mode' => 'edges',\n    'feather' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/replace-color":{"post":{"operationId":"images.replace-color","summary":"Replace color","description":"Turn every pixel close to one colour into another colour, or into transparency, with a tolerance and a soft edge; optionally keep the light and dark of the original so a red shirt becomes a blue shirt with its folds.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to change.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"from":{"type":"string","format":"color","example":"#1a73e8","description":"The colour to replace, as a hex colour. Give this or sample. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/replace-color.js"}},"sample":{"type":"string","example":"120,80","description":"Instead of from: the pixel to take the colour from, as \"x,y\" in pixels of the upright picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/replace-color.js"}},"to":{"type":"string","format":"color","default":"transparent","example":"#1a73e8","description":"The new colour as a hex colour, or transparent (default). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/replace-color.js"}},"tolerance":{"type":"number","minimum":0,"maximum":100,"default":15,"description":"How close to the colour a pixel must be to change completely, 0 to 100 (default 15).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/replace-color.js"}},"softness":{"type":"number","minimum":0,"maximum":100,"default":10,"description":"The extra band beyond the tolerance where pixels change only partly, 0 to 100 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/replace-color.js"}},"keep_shading":{"type":"boolean","default":false,"description":"true: the new colour keeps the light and dark of the old one. Default false (a flat colour).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/replace-color.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, changedPixels, share, from, to, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"changedPixels":{"type":"integer"},"share":{"type":"number","description":"Percent of the picture that changed."},"from":{"type":"string","description":"The colour that was replaced."},"to":{"type":"string"}},"required":["url","format","sizeBytes","width","height","changedPixels","share","from","to"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.replace-color","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/replace-color\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'from=#1a73e8' \\\n  -F 'sample=120,80' \\\n  -F 'to=#1a73e8'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.replaceColor({\n    \"images\": 'photo.jpg',\n    \"from\": \"#1a73e8\",\n    \"sample\": \"120,80\",\n    \"to\": \"#1a73e8\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->replaceColor([\n    'images' => 'photo.jpg',\n    'from' => '#1a73e8',\n    'sample' => '120,80',\n    'to' => '#1a73e8',\n]);\necho $result->requestId;"}]}},"/v1/images/resize":{"post":{"operationId":"images.resize","summary":"Resize an image","description":"Resize an image","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s) to resize. All files in the request are processed with the same parameters.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"width":{"type":"integer","minimum":1,"description":"Target width in pixels.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels. Empty or 0 = \"not provided\" (no resize if both dimensions are missing); decimals are truncated. A negative or non-numeric value -> 400 invalid_parameter. A size above what the plan may ask for (max_output_dimension_px, max_output_pixels) -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyResize; src/shared/param-validation.js"}},"height":{"type":"integer","minimum":1,"description":"Target height in pixels.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels. Empty or 0 = \"not provided\" (no resize if both dimensions are missing); decimals are truncated. A negative or non-numeric value -> 400 invalid_parameter. A size above what the plan may ask for (max_output_dimension_px, max_output_pixels) -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyResize; src/shared/param-validation.js"}},"resizeMode":{"type":"string","enum":["fit","cover","pad","force"],"default":"fit","description":"Fit strategy (mapped to the engine's `fit`).","x-davix-h2i-enum":"ResizeFit","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Unrecognised value -> 400 invalid_parameter. A preset (presetId) supplies this only when the field is absent.","evidence":"src/processing/images/engine.js:normalizeResizeMode"}},"gravity":{"type":"string","enum":["center","north","northeast","east","southeast","south","southwest","west","northwest","entropy","attention"],"description":"Crop/pad anchor: a compass direction or a content-aware strategy. Only affects fit=cover and fit=pad.","x-davix-h2i-enum":"ImageGravity","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Validated even when no resize happens; has no effect for fit=fit/force.","evidence":"src/processing/images/engine.js:normalizeGravity"}},"enlarge":{"type":"boolean","description":"Allow upscaling beyond the source size. When omitted the server infers it from the requested size.","x-davix-h2i-behavior":{"onInvalid":"fallback","normalization":"\"true\"/\"false\" (case-insensitive) or boolean; anything else = not specified (auto-inferred).","evidence":"src/processing/images/engine.js:parseOptionalBoolean"}},"trim":{"type":"boolean","description":"Trim uniform borders before resizing.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:parseBoolean"}},"trimThreshold":{"type":"integer","minimum":0,"maximum":255,"description":"Trim threshold: how different a pixel must be from the detected background (only used with trim=true).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Empty = default (10). Non-integer or out of range -> 400.","evidence":"src/processing/images/engine.js:applyTrim"},"x-davix-h2i-depends-on":[{"field":"trim","equals":true}]},"aspectRatio":{"type":"string","pattern":"^\\d+(\\.\\d+)?:\\d+(\\.\\d+)?$","example":"16:9","description":"\"W:H\" shorthand (e.g. 16:9) computing the missing dimension. Used only when exactly one of width/height is given.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Bad format or non-positive numbers -> 400. Ignored when both width and height are present.","evidence":"src/processing/images/engine.js:resolveAspectRatio"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"kernel":{"type":"string","enum":["nearest","linear","cubic","mitchell","lanczos2","lanczos3","mks2013","mks2021"],"description":"Resampling kernel: lanczos3 (default) is the sharpest general choice; mitchell and cubic are softer; nearest keeps hard pixel edges (pixel art). mks2013 and mks2021 are accepted and resampled with lanczos3.","x-davix-h2i-enum":"ImagesKernel","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:normalizeKernel"}},"focalX":{"type":"number","minimum":0,"maximum":1,"description":"Horizontal focal point (0 = left, 1 = right) of the source: with resizeMode=cover the crop is centred on it as far as the picture allows. Needs resizeMode=cover and both width and height.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-1 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"focalY":{"type":"number","minimum":0,"maximum":1,"description":"Vertical focal point (0 = top, 1 = bottom), see focalX.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-1 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/ImageResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.resize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","max_output_dimension_px","max_output_pixels","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/resize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'width=800' \\\n  -F 'height=600' \\\n  -F 'resizeMode=fit'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.resize({\n    \"images\": 'photo.jpg',\n    \"width\": 800,\n    \"height\": 600,\n    \"resizeMode\": \"fit\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->resize([\n    'images' => 'photo.jpg',\n    'width' => 800,\n    'height' => 600,\n    'resizeMode' => 'fit',\n]);\necho $result->requestId;"}]}},"/v1/images/resize-physical":{"post":{"operationId":"images.resize-physical","summary":"Resize in cm / inches","description":"Make a picture the physical size you want: a width and a height in centimetres, millimetres, inches or points at a resolution (dpi), or a paper or photo size such as A4 or 10 x 15 cm. The picture is cropped, fitted or stretched, the dpi is written into the file, and the answer says what resolution the source really has at that size.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to change.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"width":{"type":"number","example":"10","description":"The width in the unit (above 0). Give width, height, or both; with one the other follows the picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"height":{"type":"number","example":"15","description":"The height in the unit (above 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"unit":{"type":"string","enum":["mm","cm","in","pt","px"],"default":"cm","description":"mm, cm (default), in, pt or px. With a preset the default is mm.","x-davix-h2i-enum":"ImagesResizePhysicalUnit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"preset":{"type":"string","enum":["a0","a1","a2","a3","a4","a5","a6","a7","b4","b5","letter","legal","tabloid","photo-10x15","photo-13x18","photo-4x6","photo-5x7","photo-8x10","passport","id-card","business-card","postcard","square-10"],"example":"a4","description":"Instead of width and height: a0, a1, a2, a3, a4, a5, a6, a7, b4, b5, letter, legal, tabloid, photo-10x15, photo-13x18, photo-4x6, photo-5x7, photo-8x10, passport, id-card, business-card, postcard, square-10.","x-davix-h2i-enum":"ImagesPreset","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"orientation":{"type":"string","enum":["auto","portrait","landscape"],"default":"auto","description":"With a preset: auto (default), portrait or landscape.","x-davix-h2i-enum":"Orientation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"fit":{"type":"string","enum":["cover","contain","fill","inside","outside"],"default":"cover","description":"cover (default: fill the size and crop), contain (fit inside and pad), fill (stretch), inside or outside (keep the ratio).","x-davix-h2i-enum":"ImagesResizePhysicalFit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"position":{"type":"string","enum":["centre","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right","entropy","attention"],"default":"centre","description":"Where cover crops or contain places: centre (default), top, bottom, left, right, the four corners, entropy or attention.","x-davix-h2i-enum":"ImagesPosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"fill_color":{"type":"string","format":"color","default":"#ffffff","example":"#000000","description":"contain: the colour of the padding as a hex colour, or transparent (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"upscale":{"type":"boolean","default":true,"description":"true (default): enlarge a picture that is too small. false: never make it bigger.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"resample":{"type":"string","enum":["lanczos3","lanczos2","cubic","mitchell","nearest"],"default":"lanczos3","description":"The resampling filter: lanczos3 (default), lanczos2, cubic, mitchell or nearest (hard pixels).","x-davix-h2i-enum":"ImagesResample","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"sharpen":{"type":"boolean","default":false,"description":"true: sharpen a little after resizing. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"bleed":{"type":"number","minimum":0,"maximum":50,"default":0,"description":"Extra margin for the print shop in millimetres on every side, 0 to 50 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"min_dpi":{"type":"integer","minimum":10,"maximum":1200,"default":150,"description":"The lowest real resolution without a warning, 10 to 1200 (default 150).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/resize-physical.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, pixels: [w, h], dpi, size: { millimetres, inches }, sourcePixels, effectiveDpi, preset?, warnings?, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"pixels":{"type":"array","items":{"type":"integer"},"description":"The width and height in pixels."},"dpi":{"type":"integer","description":"The resolution that was used (written into the file)."},"size":{"type":"object","description":"millimetres and inches: [width, height] of the printed size."},"sourcePixels":{"type":"array","items":{"type":"integer"},"description":"The size of the source picture in pixels."},"effectiveDpi":{"type":"integer","description":"The resolution the source really has at the printed size."},"preset":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["url","format","sizeBytes","width","height","pixels","dpi","size","sourcePixels"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.resize-physical","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/resize-physical\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'width=10' \\\n  -F 'height=15' \\\n  -F 'unit=cm'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.resizePhysical({\n    \"images\": 'photo.jpg',\n    \"width\": \"10\",\n    \"height\": \"15\",\n    \"unit\": \"cm\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->resizePhysical([\n    'images' => 'photo.jpg',\n    'width' => '10',\n    'height' => '15',\n    'unit' => 'cm',\n]);\necho $result->requestId;"}]}},"/v1/images/scan-cleanup":{"post":{"operationId":"images.scan-cleanup","summary":"Scan cleanup","description":"Make a scan or a photo of a page look like a clean document: straighten it, cut away the border, even out shadows and uneven light, make the paper white, and give it as colour, grey or pure black and white.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The scan(s) or photo(s) of a page.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"mode":{"type":"string","enum":["color","gray","bw"],"default":"gray","description":"color keeps the colours, gray (default) makes it grey, bw makes it pure black and white (best for text and the smallest file).","x-davix-h2i-enum":"ImagesScanCleanupMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/scan-cleanup.js"}},"deskew":{"type":"boolean","default":true,"description":"true (default): find the tilt of the text lines and turn the page upright.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/scan-cleanup.js"}},"crop":{"type":"boolean","default":true,"description":"true (default): cut away the border around the page (a scanner lid, a table).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/scan-cleanup.js"}},"whiten":{"type":"boolean","default":true,"description":"true (default): even out shadows and uneven light and make the paper white.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/scan-cleanup.js"}},"margin":{"type":"integer","minimum":0,"maximum":500,"default":12,"description":"White margin to leave around the page, in pixels (default 12).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/scan-cleanup.js"}},"max_angle":{"type":"number","minimum":1,"maximum":45,"default":15,"description":"The largest tilt to look for, in degrees (default 15).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/scan-cleanup.js"}},"threshold":{"type":"integer","minimum":1,"maximum":254,"description":"With mode=bw: the grey level (1 to 254) below which a pixel becomes black. Not given: found for each page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/scan-cleanup.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, originalName, mode, deskewAngle, cropped }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"mode":{"type":"string","enum":["color","gray","bw"]},"deskewAngle":{"type":"number","description":"The turn that was applied, in degrees (0 when the page was straight or no text lines were found)."},"cropped":{"type":"boolean","description":"true when a border was cut away."}},"required":["url","format","sizeBytes","width","height","mode","deskewAngle","cropped"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.scan-cleanup","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/scan-cleanup\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'mode=gray' \\\n  -F 'margin=12' \\\n  -F 'max_angle=15'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.scanCleanup({\n    \"images\": 'photo.jpg',\n    \"mode\": \"gray\",\n    \"margin\": 12,\n    \"max_angle\": 15\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->scanCleanup([\n    'images' => 'photo.jpg',\n    'mode' => 'gray',\n    'margin' => 12,\n    'max_angle' => 15,\n]);\necho $result->requestId;"}]}},"/v1/images/signature":{"post":{"operationId":"images.signature","summary":"Signature from a photo","description":"Turn a photo of a signature on paper into a clean picture of just the ink, on a transparent (or white) background, in the colour you choose, trimmed and sized.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The photo(s) of a signature on plain paper.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"threshold":{"type":"integer","minimum":1,"maximum":254,"description":"The grey level (1 to 254) below which a pixel is ink. Not given: found for each picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"color":{"type":"string","format":"color","default":"#000000","example":"#0b2a6f","description":"The colour of the ink as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"mode":{"type":"string","enum":["soft","hard"],"default":"soft","description":"soft (default: the ink fades at its edges, the best look) or hard (ink or nothing).","x-davix-h2i-enum":"ImagesSignatureMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"background":{"type":"string","format":"color","default":"transparent","description":"transparent (default), white or a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"padding":{"type":"integer","minimum":0,"maximum":200,"default":8,"description":"Space around the ink, in pixels (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"width":{"type":"integer","minimum":0,"maximum":4000,"default":0,"description":"Resize to this width in pixels (0 = keep the size).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"trim":{"type":"boolean","default":true,"description":"true (default): cut away the empty paper around the signature.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): even out shadows and a grey sheet before reading the ink.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"smooth":{"type":"number","minimum":0,"maximum":5,"default":0.6,"description":"Blur before reading, 0 to 5 (default 0.6). More removes paper grain; less keeps thin strokes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"strength":{"type":"number","minimum":0.3,"maximum":3,"default":1,"description":"How strong the ink is drawn in soft mode, 0.3 to 3 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/signature.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, originalName, inkPercent }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"inkPercent":{"type":"number","description":"The share of the working picture that is ink, in percent."}},"required":["url","format","sizeBytes","width","height","inkPercent"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.signature","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/signature\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'threshold=1' \\\n  -F 'color=#0b2a6f' \\\n  -F 'mode=soft'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.signature({\n    \"images\": 'photo.jpg',\n    \"threshold\": 1,\n    \"color\": \"#0b2a6f\",\n    \"mode\": \"soft\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->signature([\n    'images' => 'photo.jpg',\n    'threshold' => 1,\n    'color' => '#0b2a6f',\n    'mode' => 'soft',\n]);\necho $result->requestId;"}]}},"/v1/images/slice":{"post":{"operationId":"images.slice","summary":"Cut one image into a cols x rows grid of separate output images","description":"Cut one image into a cols x rows grid of separate output images","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Exactly one image.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"cols":{"type":"integer","minimum":1,"description":"Columns.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"cols*rows must be <= 400 and every tile at least 1 pixel, otherwise 400.","evidence":"src/processing/images/engine.js:sliceImage"}},"rows":{"type":"integer","minimum":1,"description":"Rows.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","evidence":"src/processing/images/engine.js:sliceImage"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images","cols","rows"]},"encoding":{"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"row":{"type":"integer"},"col":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"sizeBytes":{"type":"integer"}},"required":["url","row","col","width","height","sizeBytes"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.slice","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/slice\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'cols=1' \\\n  -F 'rows=1' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.slice({\n    \"images\": 'photo.jpg',\n    \"cols\": 1,\n    \"rows\": 1,\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->slice([\n    'images' => 'photo.jpg',\n    'cols' => 1,\n    'rows' => 1,\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/images/social-pack":{"post":{"operationId":"images.social-pack","summary":"Social size pack","description":"Make one picture into every size social networks, ads and web pages ask for (Instagram, Facebook, X, LinkedIn, YouTube, Pinterest, TikTok, link previews ...), cropped or padded the way you choose, optionally also as one ZIP.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to resize.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"platforms":{"type":"array","example":"[\"instagram-square\",\"og-image\"]","items":{"type":"string"},"description":"Which sizes, as a list or comma-separated, or all (default). Ids: instagram-square, instagram-portrait, instagram-story, facebook-post, facebook-cover, x-post, x-header, linkedin-post, linkedin-banner, youtube-thumbnail, youtube-banner, pinterest-pin, tiktok, whatsapp-status, og-image, avatar-square, email-header.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/social-pack.js"}},"fit":{"type":"string","enum":["cover","contain","fill"],"default":"cover","description":"cover (default: fill the size and cut what does not fit), contain (show the whole picture, pad the rest) or fill (stretch).","x-davix-h2i-enum":"ImagesSocialPackFit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/social-pack.js"}},"position":{"type":"string","default":"center","description":"The part kept with cover (or where the picture sits with contain): center (default), top, bottom, left, right, top-left, top-right, bottom-left, bottom-right, attention or entropy (the most interesting part).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/social-pack.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"With contain: the colour of the padding as a hex colour (default #ffffff) or transparent. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/social-pack.js"}},"scale":{"type":"number","minimum":0.25,"maximum":3,"default":1,"description":"Make every size larger or smaller, 0.25 to 3 (default 1; 2 for retina screens).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/social-pack.js"}},"zip":{"type":"boolean","default":false,"description":"true: also put all the sizes in one ZIP (zipUrl). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/social-pack.js"}},"no_upscale":{"type":"boolean","default":false,"description":"With contain or fill: do not make a small picture larger than it is. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/social-pack.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"platforms":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, originalName, platform, label, targetWidth, targetHeight }], count, zipUrl?, zipBytes? }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"platform":{"type":"string","description":"The id of the size."},"label":{"type":"string","description":"Its name, for example \"Instagram post (square)\"."},"targetWidth":{"type":"integer"},"targetHeight":{"type":"integer"}},"required":["url","format","sizeBytes","width","height","platform","label","targetWidth","targetHeight"]}},"count":{"type":"integer"},"zipUrl":{"type":"string","format":"uri","description":"The ZIP with every size, when zip is true."},"zipBytes":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","count"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.social-pack","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/social-pack\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'platforms=[\"instagram-square\",\"og-image\"]' \\\n  -F 'fit=cover' \\\n  -F 'scale=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.socialPack({\n    \"images\": 'photo.jpg',\n    \"platforms\": \"[\\\"instagram-square\\\",\\\"og-image\\\"]\",\n    \"fit\": \"cover\",\n    \"scale\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->socialPack([\n    'images' => 'photo.jpg',\n    'platforms' => '[\"instagram-square\",\"og-image\"]',\n    'fit' => 'cover',\n    'scale' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/sprite-sheet":{"post":{"operationId":"images.sprite-sheet","summary":"Pack multiple images edge-to-edge into one sprite sheet, with a per-image coordinate manifest","description":"Pack multiple images edge-to-edge into one sprite sheet, with a per-image coordinate manifest","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"maxItems":100,"description":"Images (1-100).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"1-100 images (MAX_LAYOUT_IMAGES). Accepted types are enforced per upload; plan limits apply."}},"cols":{"type":"integer","minimum":1,"description":"Columns.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Math.max(1, parseInt(cols)); non-numeric -> automatic (ceil(sqrt(n))). No upper bound besides the 100-image and pixel limits.","evidence":"src/processing/images/engine.js:buildImageLayout"}},"cellWidth":{"type":"integer","minimum":1,"description":"Cell width (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels, at least 1. Empty -> the largest input dimension. Non-numeric, 0 or negative -> 400 invalid_parameter. A sheet above the plan's result-size limits (max_output_dimension_px, max_output_pixels) or the raw-effect pixel limit -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"cellHeight":{"type":"integer","minimum":1,"description":"Cell height (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels, at least 1. Empty -> the largest input dimension. Non-numeric, 0 or negative -> 400 invalid_parameter. A sheet above the plan's result-size limits (max_output_dimension_px, max_output_pixels) or the raw-effect pixel limit -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"background":{"type":"string","format":"color","default":"#00000000","description":"Sheet / letterbox background (hex, optionally with alpha). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Any CSS colour (names, #rgb, #rrggbb, #rrggbbaa, rgb()/rgba()). Empty -> the default colour. An unparseable value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:buildImageLayout; src/shared/param-validation.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"labels":{"type":"string","enum":["none","filename","index"],"default":"none","description":"Write a caption under every picture: `filename` (the uploaded file's name), `index` (1, 2, 3, ...) or `none` (default).","x-davix-h2i-enum":"ImagesLabels","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelFontFamily":{"type":"string","maxLength":100,"description":"Font of the captions (GET /v1/formats lists the installed families). Default sans-serif; any script works.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A family that is not installed -> 400 font_unavailable.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelFontSize":{"type":"integer","minimum":6,"maximum":100,"description":"Caption size in pixels (6-100, default 14).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 6-100 -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"labelColor":{"type":"string","format":"color","description":"Caption colour (default #333333). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"padding":{"type":"integer","minimum":0,"maximum":500,"default":0,"description":"Empty margin around the whole sheet in pixels (0-500), on top of the spacing between pictures.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-500 -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseLayoutExtras"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/LayoutResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"images","minFiles":1,"ceiling":100,"directFiles":100,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"images.sprite-sheet","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","max_output_dimension_px","max_output_pixels","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/sprite-sheet\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'cols=1' \\\n  -F 'cellWidth=1' \\\n  -F 'cellHeight=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.spriteSheet({\n    \"images\": 'photo.jpg',\n    \"cols\": 1,\n    \"cellWidth\": 1,\n    \"cellHeight\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->spriteSheet([\n    'images' => 'photo.jpg',\n    'cols' => 1,\n    'cellWidth' => 1,\n    'cellHeight' => 1,\n]);\necho $result->requestId;"}]}},"/v1/images/stamp":{"post":{"operationId":"images.stamp","summary":"Company stamp","description":"Make a company stamp as a transparent PNG: round, oval or rectangular, with text on an arc or on lines, a centre text, stars, a double border, a slight turn and a worn-ink effect, ready to place on a PDF.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"text":{"type":"string","example":"APPROVED","description":"The main text in the middle (up to 120 characters, up to 3 lines separated by a new line).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"shape":{"type":"string","enum":["round","oval","rectangle","rounded-rectangle"],"default":"round","description":"round (default), oval, rectangle or rounded-rectangle.","x-davix-h2i-enum":"ImagesStampShape","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"top_text":{"type":"string","example":"ACME GMBH","description":"Text above the centre: on the arc (round, oval) or a line (rectangles), up to 60 characters.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"bottom_text":{"type":"string","example":"BERLIN","description":"Text below the centre, up to 60 characters.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"color":{"type":"string","format":"color","default":"#b91c1c","example":"#1a73e8","description":"The ink colour as a hex colour (default #b91c1c). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"border":{"type":"number","minimum":2,"maximum":40,"default":10,"description":"The border width, 2 to 40 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"double_border":{"type":"boolean","default":true,"description":"true (default): a thin second border inside the first.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"size":{"type":"integer","minimum":200,"maximum":1600,"default":600,"description":"The size in pixels, 200 to 1600 (default 600).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"rotation":{"type":"number","minimum":-45,"maximum":45,"default":-8,"description":"Turn the stamp, -45 to 45 degrees (default -8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"distress":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"A worn-ink effect: 0 (clean, default) to 100 (very worn).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"font":{"type":"string","enum":["sans","serif","mono"],"default":"sans","description":"sans (default), serif or mono.","x-davix-h2i-enum":"Font","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"stars":{"type":"boolean","default":true,"description":"With round and oval stamps that have an arc text: a star at each end of the arc (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"background":{"type":"string","format":"color","default":"transparent","example":"#1a73e8","description":"The fill inside the stamp as a hex colour, or transparent (default). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/stamp.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["text"]}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, shape }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"shape":{"type":"string"}},"required":["url","format","sizeBytes","width","height","shape"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout"],"x-davix-h2i-id":"images.stamp","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/stamp\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text=APPROVED' \\\n  -F 'shape=round' \\\n  -F 'top_text=ACME GMBH'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.stamp({\n    \"text\": \"APPROVED\",\n    \"shape\": \"round\",\n    \"top_text\": \"ACME GMBH\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->stamp([\n    'text' => 'APPROVED',\n    'shape' => 'round',\n    'top_text' => 'ACME GMBH',\n]);\necho $result->requestId;"}]}},"/v1/images/sticker":{"post":{"operationId":"images.sticker","summary":"Sticker outline","description":"Give a cut-out picture the thick outline of a die-cut sticker (and an optional second outline and shadow), following its exact shape; a picture without transparency gets its plain background cut away first.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The picture(s) to turn into stickers (a PNG or WebP with a transparent background works best).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"width":{"type":"integer","minimum":0,"maximum":100,"default":14,"description":"The outline width in pixels, 0 to 100 (default 14).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"color":{"type":"string","format":"color","default":"#ffffff","example":"#1a73e8","description":"The outline colour as a hex colour (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"outer_width":{"type":"integer","minimum":0,"maximum":60,"default":0,"description":"A second outline outside the first, in pixels, 0 to 60 (default 0: none).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"outer_color":{"type":"string","format":"color","default":"#18181b","example":"#1a73e8","description":"The colour of the second outline (default #18181b). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"smooth":{"type":"number","minimum":0,"maximum":40,"default":0,"description":"Round off the corners of the outline, 0 to 40 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"shadow":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"A soft shadow under the sticker, 0 (none, default) to 100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"cut_background":{"type":"string","enum":["auto","none"],"default":"auto","description":"auto (default): a picture with no transparency has its plain background (the colour of its corners) cut away. none: use the picture as it is.","x-davix-h2i-enum":"ImagesCutBackground","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"tolerance":{"type":"number","minimum":0,"maximum":100,"default":12,"description":"With cut_background=auto: how far from the corner colour a pixel may be and still count as background, 0 to 100 (default 12).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"padding":{"type":"integer","minimum":0,"maximum":200,"default":0,"description":"Empty space kept around the sticker in pixels, 0 to 200 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/sticker.js"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, backgroundCut, cutPixels, hadTransparency, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"backgroundCut":{"type":"boolean","description":"true when the plain background was removed."},"cutPixels":{"type":"integer"},"hadTransparency":{"type":"boolean"}},"required":["url","format","sizeBytes","width","height","backgroundCut","cutPixels","hadTransparency"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.sticker","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/sticker\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'width=14' \\\n  -F 'color=#1a73e8' \\\n  -F 'outer_width=0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.sticker({\n    \"images\": 'photo.jpg',\n    \"width\": 14,\n    \"color\": \"#1a73e8\",\n    \"outer_width\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->sticker([\n    'images' => 'photo.jpg',\n    'width' => 14,\n    'color' => '#1a73e8',\n    'outer_width' => 0,\n]);\necho $result->requestId;"}]}},"/v1/images/svg-edit":{"post":{"operationId":"images.svg-edit","summary":"SVG edit","description":"Edit an SVG without a vector editor: swap colours, remove elements, set attributes, resize, crop or pad the canvas, add a background, turn or mirror it, and save it as SVG or PNG. Nothing that can run code survives.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The SVG file to edit.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"replace_colors":{"type":"object","example":"{\"#ff0000\":\"#00aa00\"}","description":"Colours to swap: { \"#ff0000\": \"#00aa00\" }, in fill, stroke, stop-color, style attributes and style sheets (hex and common colour names).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"remove":{"type":"array","example":"[\"#background\",\".debug\"]","items":{"type":"string"},"description":"Elements to remove: a list of selectors such as #logo, .shadow, circle or path.accent.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"set_attributes":{"type":"object","example":"{\"#logo\":{\"opacity\":\"0.5\"}}","description":"Attributes to set: { \"selector\": { \"attribute\": \"value\" } }, for example {\"path.accent\":{\"stroke-width\":\"3\"}}.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"viewbox":{"type":"string","example":"0 0 100 60","description":"Crop or move the canvas: \"x y width height\" in the units of the drawing.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"padding":{"type":"number","minimum":0,"maximum":100000,"default":0,"description":"Add this much empty space around the canvas, in drawing units (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"background":{"type":"string","format":"color","example":"#1a73e8","description":"Fill the canvas with this hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"rotate":{"type":"integer","minimum":0,"maximum":270,"default":0,"description":"Turn clockwise: 0 (default), 90, 180 or 270 degrees.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"flip":{"type":"string","enum":["none","horizontal","vertical","both"],"default":"none","description":"none (default), horizontal, vertical or both.","x-davix-h2i-enum":"ImagesFlip","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"width":{"type":"number","minimum":1,"maximum":20000,"description":"Set the width of the SVG (the height follows the canvas ratio unless given).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"height":{"type":"number","minimum":1,"maximum":20000,"description":"Set the height of the SVG.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"remove_metadata":{"type":"boolean","default":false,"description":"true: remove <metadata>, <title> and <desc>. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"output":{"type":"string","enum":["svg","png"],"default":"svg","description":"svg (default) or png.","x-davix-h2i-enum":"ImagesSvgEditOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"png_width":{"type":"integer","minimum":16,"maximum":8000,"description":"With output=png: the width in pixels, 16 to 8000 (default: the SVG width, at most 4000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-edit.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"replace_colors":{"contentType":"application/json"},"remove":{"contentType":"application/json"},"set_attributes":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, recolored, removed, attributesSet, viewBox, originalName }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"originalName":{"type":"string"},"recolored":{"type":"integer"},"removed":{"type":"integer"},"attributesSet":{"type":"integer"},"viewBox":{"type":"string"}},"required":["url","format","sizeBytes","width","height","recolored","removed","attributesSet","viewBox"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.svg-edit","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/svg-edit\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'replace_colors={\"#ff0000\":\"#00aa00\"}' \\\n  -F 'remove=[\"#background\",\".debug\"]' \\\n  -F 'set_attributes={\"#logo\":{\"opacity\":\"0.5\"}}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.svgEdit({\n    \"images\": 'photo.jpg',\n    \"replace_colors\": \"{\\\"#ff0000\\\":\\\"#00aa00\\\"}\",\n    \"remove\": \"[\\\"#background\\\",\\\".debug\\\"]\",\n    \"set_attributes\": \"{\\\"#logo\\\":{\\\"opacity\\\":\\\"0.5\\\"}}\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->svgEdit([\n    'images' => 'photo.jpg',\n    'replace_colors' => '{\"#ff0000\":\"#00aa00\"}',\n    'remove' => '[\"#background\",\".debug\"]',\n    'set_attributes' => '{\"#logo\":{\"opacity\":\"0.5\"}}',\n]);\necho $result->requestId;"}]}},"/v1/images/svg-optimize":{"post":{"operationId":"images.svg-optimize","summary":"Optimize SVG","description":"Make an SVG file smaller (SVGO) and take out anything that could run code: script elements, on* handlers, javascript: links and foreign objects.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"The SVG file(s). Other picture formats are refused.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"precision":{"type":"integer","minimum":0,"maximum":8,"default":3,"description":"Digits to keep after the decimal point in numbers, 0 to 8 (default 3). Fewer digits make a smaller file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-optimize.js"}},"multipass":{"type":"boolean","default":true,"description":"true (default): optimize repeatedly until nothing more is gained.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-optimize.js"}},"pretty":{"type":"boolean","default":false,"description":"true: write the result indented so that it can be read. Default false (smallest).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-optimize.js"}},"keep_viewbox":{"type":"boolean","default":true,"description":"true (default): keep the viewBox, so the SVG still scales.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-optimize.js"}},"remove_dimensions":{"type":"boolean","default":false,"description":"true: remove width and height so the SVG fills the space it is put in (needs a viewBox). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-optimize.js"}},"remove_title":{"type":"boolean","default":false,"description":"true: remove title and desc (they help screen readers, so they are kept by default).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-optimize.js"}},"keep_ids":{"type":"boolean","default":false,"description":"true: keep every id (use it when a script or a style sheet outside the SVG refers to them). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-optimize.js"}},"remove_scripts":{"type":"boolean","default":true,"description":"true (default): remove script elements, foreign objects, on* handlers and javascript: links.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/svg-optimize.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. It does not run the operation, so a problem that only shows while processing (a crop outside the image, an unreadable file) is not found.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, originalBytes, savedPercent, originalName, removed?, warnings? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"originalBytes":{"type":"integer"},"savedPercent":{"type":"number","description":"How much smaller the file is, in percent."},"originalName":{"type":"string"},"removed":{"type":"array","items":{"type":"string"},"description":"What was removed because it can run code."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["url","format","sizeBytes","originalBytes","savedPercent"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.svg-optimize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/svg-optimize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'precision=3' \\\n  -F 'multipass=true' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.svgOptimize({\n    \"images\": 'photo.jpg',\n    \"precision\": 3,\n    \"multipass\": true,\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->svgOptimize([\n    'images' => 'photo.jpg',\n    'precision' => 3,\n    'multipass' => true,\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/images/transform":{"post":{"operationId":"images.transform","summary":"Crop/resize/rotate/flip/enhance in one call","description":"Crop/resize/rotate/flip/enhance in one call","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s) to transform.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"crop.x":{"type":"integer","description":"Crop left offset (px). All four crop.* fields are needed together.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number >= 0. The four crop values must be given together (400 if only some are); a crop outside the image -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyCrop; src/shared/param-validation.js"},"x-davix-h2i-depends-on":[{"field":"crop.y","present":true},{"field":"crop.width","present":true},{"field":"crop.height","present":true}]},"crop.y":{"type":"integer","description":"Crop top offset (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number >= 0. The four crop values must be given together (400 if only some are); a crop outside the image -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyCrop; src/shared/param-validation.js"},"x-davix-h2i-depends-on":[{"field":"crop.x","present":true},{"field":"crop.width","present":true},{"field":"crop.height","present":true}]},"crop.width":{"type":"integer","description":"Crop width (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number >= 1. The four crop values must be given together (400 if only some are); a crop outside the image -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyCrop; src/shared/param-validation.js"},"x-davix-h2i-depends-on":[{"field":"crop.x","present":true},{"field":"crop.y","present":true},{"field":"crop.height","present":true}]},"crop.height":{"type":"integer","description":"Crop height (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number >= 1. The four crop values must be given together (400 if only some are); a crop outside the image -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyCrop; src/shared/param-validation.js"},"x-davix-h2i-depends-on":[{"field":"crop.x","present":true},{"field":"crop.y","present":true},{"field":"crop.width","present":true}]},"resize.width":{"type":"integer","minimum":1,"description":"Resize target width (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels. Empty or 0 = \"not provided\" (no resize if both dimensions are missing); decimals are truncated. A negative or non-numeric value -> 400 invalid_parameter. A size above what the plan may ask for (max_output_dimension_px, max_output_pixels) -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyResize; src/shared/param-validation.js"}},"resize.height":{"type":"integer","minimum":1,"description":"Resize target height (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels. Empty or 0 = \"not provided\" (no resize if both dimensions are missing); decimals are truncated. A negative or non-numeric value -> 400 invalid_parameter. A size above what the plan may ask for (max_output_dimension_px, max_output_pixels) -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyResize; src/shared/param-validation.js"}},"resize.fit":{"type":"string","enum":["fit","cover","pad","force"],"default":"fit","description":"How the image is fitted into width x height.","x-davix-h2i-enum":"ResizeFit","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Unrecognised value -> 400 invalid_parameter. Omitted/empty -> \"fit\".","evidence":"src/processing/images/engine.js:normalizeResizeMode"}},"resize.enlarge":{"type":"boolean","description":"Allow upscaling (auto-inferred when omitted).","x-davix-h2i-behavior":{"onInvalid":"fallback","evidence":"src/processing/images/engine.js:parseOptionalBoolean"}},"resize.gravity":{"type":"string","enum":["center","north","northeast","east","southeast","south","southwest","west","northwest","entropy","attention"],"description":"Crop/pad anchor: a compass direction or a content-aware strategy. Only affects fit=cover and fit=pad.","x-davix-h2i-enum":"ImageGravity","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Validated even when no resize happens; has no effect for fit=fit/force.","evidence":"src/processing/images/engine.js:normalizeGravity"}},"rotate.angle":{"type":"integer","description":"Rotation in degrees (clockwise). Any integer is accepted; non-multiples of 90 expand the canvas.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of degrees. Empty = no rotation; a non-numeric value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyRotate; src/shared/param-validation.js"}},"flip.axis":{"type":"string","enum":["horizontal","vertical"],"description":"Mirror axis: horizontal = left-right, vertical = up-down.","x-davix-h2i-enum":"FlipAxis","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:applyFlip"}},"enhance.blur":{"type":"number","minimum":0,"maximum":500,"description":"Gaussian blur sigma (0 = a mild default blur).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0,500]; non-numeric ignored.","evidence":"src/processing/images/engine.js:applyEnhance"}},"enhance.sharpen":{"type":"number","minimum":0,"maximum":10,"description":"Sharpen amount (0 = the default sharpen; \"true\" = 1).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0,10]; the string \"true\" means 1; other non-numeric ignored.","evidence":"src/processing/images/engine.js:applyEnhance"}},"enhance.grayscale":{"type":"boolean","description":"Convert to grayscale.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:parseBoolean"}},"enhance.sepia":{"type":"boolean","description":"Apply a sepia tone.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:parseBoolean"}},"enhance.brightness":{"type":"number","minimum":0,"maximum":2,"default":1,"description":"Brightness multiplier (1 = unchanged).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0,2]; non-numeric -> 1.","evidence":"src/processing/images/engine.js:applyEnhance"}},"enhance.saturation":{"type":"number","minimum":0,"maximum":2,"default":1,"description":"Saturation multiplier (1 = unchanged).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0,2]; non-numeric -> 1.","evidence":"src/processing/images/engine.js:applyEnhance"}},"enhance.contrast":{"type":"number","minimum":0,"maximum":2,"default":1,"description":"Contrast multiplier (1 = unchanged).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0,2]; non-numeric -> 1.","evidence":"src/processing/images/engine.js:applyEnhance"}},"enhance.gamma":{"type":"number","minimum":1,"maximum":3,"description":"Gamma correction.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1.0,3.0] or non-numeric -> 400.","evidence":"src/processing/images/engine.js:validateGamma"}},"enhance.threshold":{"type":"integer","minimum":0,"maximum":255,"description":"Binary threshold.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [0,255] or non-integer -> 400.","evidence":"src/processing/images/engine.js:validateThreshold"}},"enhance.tint":{"type":"string","format":"color","description":"Tint color. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Invalid color -> 400 invalid_parameter (#rgb or #rrggbb).","evidence":"src/processing/shared/watermark-geometry.js:validateHexColor"}},"enhance.negate":{"type":"boolean","description":"Invert colors.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:parseBoolean"}},"enhance.median":{"type":"integer","minimum":1,"maximum":49,"description":"Median filter window.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1,49] or non-integer -> 400.","evidence":"src/processing/images/engine.js:validateMedian"}},"enhance.clahe":{"type":"object","properties":{"width":{"type":"integer","minimum":1,"maximum":8192,"description":"Tile width (px)."},"height":{"type":"integer","minimum":1,"maximum":8192,"description":"Tile height (px)."},"maxSlope":{"type":"integer","minimum":0,"maximum":100,"description":"Contrast limit."}},"required":["width","height"],"description":"CLAHE local contrast. JSON object {width,height,maxSlope?}.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Invalid JSON or out-of-range values -> 400.","evidence":"src/processing/images/engine.js:validateClahe"}},"enhance.hue":{"type":"number","minimum":-360,"maximum":360,"description":"Hue shift in degrees.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [-360,360] -> 400.","evidence":"src/processing/images/engine.js:validateHue"}},"enhance.exposure":{"type":"number","minimum":-3,"maximum":3,"description":"Exposure in stops (2^value multiplier).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [-3,3] -> 400.","evidence":"src/processing/images/engine.js:validateExposure"}},"enhance.emboss":{"type":"boolean","description":"Emboss preset kernel.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:applyEmboss"}},"enhance.edgeDetect":{"type":"boolean","description":"Edge-detect preset kernel.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","evidence":"src/processing/images/engine.js:applyEdgeDetect"}},"enhance.noise":{"type":"number","maximum":100,"exclusiveMinimum":0,"description":"Film-grain strength (0 exclusive .. 100).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"<=0, >100 or non-numeric -> 400. Images over 40,000,000 pixels are rejected for raw-pixel effects.","evidence":"src/processing/images/engine.js:applyNoise"}},"enhance.vignette":{"type":"number","maximum":1,"exclusiveMinimum":0,"description":"Vignette intensity (0 exclusive .. 1).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"<=0, >1 or non-numeric -> 400.","evidence":"src/processing/images/engine.js:applyVignette"}},"enhance.vignetteColor":{"type":"string","format":"color","default":"#000000","description":"Vignette color (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Invalid color -> 400 invalid_parameter (#rgb or #rrggbb).","evidence":"src/processing/shared/watermark-geometry.js:validateHexColor"}},"enhance.pixelate":{"type":"integer","minimum":2,"maximum":500,"description":"Pixel block size.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [2,500] -> 400.","evidence":"src/processing/images/engine.js:applyPixelate"}},"enhance.posterize":{"type":"integer","minimum":2,"maximum":32,"description":"Number of color levels.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [2,32] -> 400.","evidence":"src/processing/images/engine.js:applyPosterize"}},"enhance.duotoneShadow":{"type":"string","format":"color","default":"#000000","description":"Duotone shadow color (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Invalid color -> 400 invalid_parameter (#rgb or #rrggbb).","evidence":"src/processing/shared/watermark-geometry.js:validateHexColor"}},"enhance.duotoneHighlight":{"type":"string","format":"color","default":"#ffffff","description":"Duotone highlight color (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Invalid color -> 400 invalid_parameter (#rgb or #rrggbb).","evidence":"src/processing/shared/watermark-geometry.js:validateHexColor"}},"colorSpace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Output color space.","x-davix-h2i-enum":"ColorSpace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Validated at the route boundary (400).","evidence":"src/api/images/transform.js"}},"convolve":{"type":"object","properties":{"width":{"type":"integer","minimum":3,"maximum":21,"description":"Kernel width (odd)."},"height":{"type":"integer","minimum":3,"maximum":21,"description":"Kernel height (odd)."},"kernel":{"type":"array","items":{"type":"number"},"description":"width*height finite numbers."},"scale":{"type":"number","description":"Non-zero divisor."},"offset":{"type":"number","description":"Finite offset."}},"required":["width","height","kernel"],"description":"Custom convolution. JSON object.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Kernel size must be odd, 3..21 in each dimension; kernel length must equal width*height.","evidence":"src/processing/images/engine.js:applyConvolve"}},"affine":{"type":"object","properties":{"matrix":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"number"},"description":"[a,b,c,d] 2x2 matrix (not a perspective transform)."},"background":{"type":"string","format":"color","description":"Fill color. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"interpolator":{"type":"string","enum":["nearest","bilinear","bicubic","locallyBoundedBicubic","nohalo","vertexSplitQuadraticBasisSpline"],"description":"Interpolation.","x-davix-h2i-enum":"ImagesInterpolator"}},"required":["matrix"],"description":"2D affine transform. JSON object.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/engine.js:applyAffine"}},"channelExtract":{"type":"string","enum":["red","green","blue","alpha"],"description":"Extract a single channel by name (an integer 0-3 is also accepted).","x-davix-h2i-enum":"ImagesChannelExtract","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"names lower-cased; integers 0-3 accepted as aliases","evidence":"src/processing/images/engine.js:applyChannelExtract"}},"background.color":{"type":"string","format":"color","description":"Flatten transparent areas onto this color. Only applies to images that have an alpha channel. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Invalid color -> 400 invalid_parameter (#rgb or #rrggbb).","evidence":"src/processing/shared/watermark-geometry.js:validateHexColor"}},"background.blur":{"type":"number","minimum":0,"maximum":200,"description":"Fill transparent areas with a blurred copy of the image (sigma).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0,200]; a value of 0 or a non-number falls back to 20. Takes precedence over background.color. No-op for images without alpha.","evidence":"src/processing/images/engine.js:applyBackground"}},"padding.top":{"type":"integer","minimum":0,"description":"Top padding (px).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","note":"Negative values are clamped to 0; padding.all overrides the four sides.","evidence":"src/processing/images/engine.js:applyPadding"}},"padding.right":{"type":"integer","minimum":0,"description":"Right padding (px).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","evidence":"src/processing/images/engine.js:applyPadding"}},"padding.bottom":{"type":"integer","minimum":0,"description":"Bottom padding (px).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","evidence":"src/processing/images/engine.js:applyPadding"}},"padding.left":{"type":"integer","minimum":0,"description":"Left padding (px).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","evidence":"src/processing/images/engine.js:applyPadding"}},"padding.all":{"type":"integer","minimum":0,"description":"Padding on all four sides (px); overrides top/right/bottom/left.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels >= 0 (negative or non-numeric -> 400 invalid_parameter). The padded image counts toward the plan's result-size limits.","evidence":"src/processing/images/engine.js:applyPadding; src/shared/param-validation.js"}},"padding.color":{"type":"string","format":"color","default":"#ffffff","description":"Padding color (default #ffffff). Not validated by Davix H2I. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Any CSS colour (names, #rgb, #rrggbb, #rrggbbaa, rgb()/rgba()). Empty -> the default colour. An unparseable value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyPadding; src/shared/param-validation.js"}},"border.width":{"type":"integer","minimum":0,"description":"Border width (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels >= 0 (negative or non-numeric -> 400 invalid_parameter). The bordered image counts toward the plan's result-size limits.","evidence":"src/processing/images/engine.js:applyBorder; src/shared/param-validation.js"}},"border.color":{"type":"string","format":"color","default":"#000000","description":"Border color (default #000000). Not validated by Davix H2I. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Any CSS colour (names, #rgb, #rrggbb, #rrggbbaa, rgb()/rgba()). Empty -> the default colour. An unparseable value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:applyBorder; src/shared/param-validation.js"}},"border.radius":{"type":"integer","minimum":0,"description":"Corner radius (px); adds transparency (flattened for JPEG).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","evidence":"src/processing/images/engine.js:applyBorder"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"resize.kernel":{"type":"string","enum":["nearest","linear","cubic","mitchell","lanczos2","lanczos3","mks2013","mks2021"],"description":"Resampling kernel (see /v1/images/resize `kernel`).","x-davix-h2i-enum":"ImagesResizeKernel","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/engine.js:normalizeKernel"}},"resize.focalX":{"type":"number","minimum":0,"maximum":1,"description":"Focal point x (0-1) for resize.fit=cover.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-1 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"resize.focalY":{"type":"number","minimum":0,"maximum":1,"description":"Focal point y (0-1) for resize.fit=cover.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-1 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"levels.inputBlack":{"type":"integer","minimum":0,"maximum":254,"description":"Levels: input value (0-254) that becomes black.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-254 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"levels.inputWhite":{"type":"integer","minimum":1,"maximum":255,"description":"Levels: input value (1-255) that becomes white. Must be greater than levels.inputBlack.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-255 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"levels.gamma":{"type":"number","minimum":0.1,"maximum":10,"description":"Levels: midtone gamma (0.1-10); above 1 brightens the midtones, below 1 darkens them.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0.1-10 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"levels.outputBlack":{"type":"integer","minimum":0,"maximum":255,"description":"Levels: lowest output value (0-255), to lift the blacks.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-255 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"levels.outputWhite":{"type":"integer","minimum":0,"maximum":255,"description":"Levels: highest output value (0-255), to cap the whites.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-255 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"curves":{"type":"object","description":"Tone curves as control points per channel: {\"master\":[[0,0],[128,150],[255,255]],\"r\":[...],\"g\":[...],\"b\":[...]}. Points are [input, output] between 0 and 255; a smooth monotone curve is drawn through them. `master` is applied first, then the colour channels.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, an unknown channel, fewer than 2 or more than 32 points, a point outside 0-255, or two points at one x -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"lut":{"type":"object","description":"A custom look-up table: {\"all\":[256 integers],\"r\":[256],\"g\":[256],\"b\":[256]} with values 0-255. `all` is applied first, then the colour channels. Applied after levels and curves.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, an unknown channel, or a table that is not exactly 256 integers 0-255 -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"autoLevel":{"type":"boolean","description":"true = stretch the tones so the darkest pixels become black and the lightest white (clipping `autoLevelClip` percent at each end).","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/processing/images/adjustments.js:applyAutoLevel"}},"autoLevelClip":{"type":"number","minimum":0,"maximum":20,"description":"Percent of the darkest and lightest pixels ignored when auto-levelling (0-20, default 1).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-20 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"denoise":{"type":"integer","minimum":1,"maximum":3,"description":"Noise reduction strength 1-3 (a median filter of 3, 5 or 7 pixels): higher removes more noise and more fine detail.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-3 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"maskImage":{"type":"string","format":"binary","description":"A mask: its brightness becomes the picture's opacity (white keeps, black hides). Scaled to the picture's size.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"mask.invert":{"type":"boolean","description":"true = black keeps and white hides.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/processing/images/adjustments.js:applyMask"}},"blendImage":{"type":"string","format":"binary","description":"A second image blended over the picture. Scaled to the picture's size (blend.fit).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"blend.mode":{"type":"string","enum":["over","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","add","saturate"],"default":"over","description":"How blendImage combines with the picture.","x-davix-h2i-enum":"ImagesTransformBlendMode","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/adjustments.js:applyBlend"}},"blend.opacity":{"type":"number","minimum":0,"maximum":1,"description":"Opacity of blendImage (0-1, default 1).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 0-1 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/adjustments.js"}},"blend.fit":{"type":"string","enum":["cover","contain","fill"],"default":"cover","description":"How blendImage is fitted to the picture: cover (fill, crop the overflow), contain (fit inside, transparent margin), fill (stretch).","x-davix-h2i-enum":"ImagesBlendFit","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/adjustments.js:applyBlend"}},"blend.gravity":{"type":"string","enum":["center","north","northeast","east","southeast","south","southwest","west","northwest"],"default":"center","description":"Where blendImage sits when blend.fit crops or leaves a margin.","x-davix-h2i-enum":"ImagesBlendGravity","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/images/adjustments.js:applyBlend"}},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"enhance.clahe":{"contentType":"application/json"},"convolve":{"contentType":"application/json"},"affine":{"contentType":"application/json"},"curves":{"contentType":"application/json"},"lut":{"contentType":"application/json"},"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/ImageResult"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-actions":{"selector":null,"style":"flags","items":[{"name":"crop","fields":["crop.x","crop.y","crop.width","crop.height"],"requiredFields":["crop.x","crop.y","crop.width","crop.height"],"evidence":"src/processing/images/engine.js:applyCrop"},{"name":"resize","fields":["resize.width","resize.height","resize.fit","resize.enlarge","resize.gravity","resize.kernel","resize.focalX","resize.focalY"],"evidence":"src/processing/images/engine.js:applyResize"},{"name":"rotate","fields":["rotate.angle"]},{"name":"flip","fields":["flip.axis"]},{"name":"enhance","fields":["enhance.blur","enhance.sharpen","enhance.grayscale","enhance.sepia","enhance.brightness","enhance.saturation","enhance.contrast","enhance.gamma","enhance.threshold","enhance.tint","enhance.negate","enhance.median","enhance.clahe","enhance.hue","enhance.exposure","enhance.emboss","enhance.edgeDetect","enhance.noise","enhance.vignette","enhance.vignetteColor","enhance.pixelate","enhance.posterize","enhance.duotoneShadow","enhance.duotoneHighlight"]},{"name":"convolve","fields":["convolve"]},{"name":"affine","fields":["affine"]},{"name":"channelExtract","fields":["channelExtract"]},{"name":"background","fields":["background.color","background.blur"]},{"name":"padding","fields":["padding.top","padding.right","padding.bottom","padding.left","padding.all","padding.color"]},{"name":"border","fields":["border.width","border.color","border.radius"]},{"name":"colorSpace","fields":["colorSpace"]},{"name":"levels","fields":["levels.inputBlack","levels.inputWhite","levels.gamma","levels.outputBlack","levels.outputWhite"]},{"name":"curves","fields":["curves"]},{"name":"lut","fields":["lut"]},{"name":"autoLevel","fields":["autoLevel","autoLevelClip"]},{"name":"denoise","fields":["denoise"]},{"name":"mask","fields":["maskImage","mask.invert"]},{"name":"blend","fields":["blendImage","blend.mode","blend.opacity","blend.fit","blend.gravity"]}]},"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.transform","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","max_output_dimension_px","max_output_pixels","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/transform\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'resize.width=1' \\\n  -F 'resize.height=1' \\\n  -F 'resize.fit=fit'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.transform({\n    \"images\": 'photo.jpg',\n    \"resize.width\": 1,\n    \"resize.height\": 1,\n    \"resize.fit\": \"fit\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->transform([\n    'images' => 'photo.jpg',\n    'resize.width' => 1,\n    'resize.height' => 1,\n    'resize.fit' => 'fit',\n]);\necho $result->requestId;"}]}},"/v1/images/variants":{"post":{"operationId":"images.variants","summary":"Generate N named variants from one input image","description":"Generate N named variants from one input image","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"Exactly one source image.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"variants":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Unique variant name.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Missing/blank or duplicate names -> 400 (attributed by variantName).","evidence":"src/processing/images/engine.js:applyVariants"}},"width":{"type":"integer","minimum":1,"description":"Target width (px)."},"height":{"type":"integer","minimum":1,"description":"Target height (px)."},"fit":{"type":"string","enum":["fit","cover","pad","force"],"description":"Fit strategy.","x-davix-h2i-enum":"ResizeFit"},"gravity":{"type":"string","enum":["center","north","northeast","east","southeast","south","southwest","west","northwest","entropy","attention"],"description":"Anchor.","x-davix-h2i-enum":"ImageGravity"},"enlarge":{"type":"boolean","description":"Allow upscaling."},"format":{"type":"string","enum":["jpeg","png","webp","avif","gif","tiff"],"description":"Output format.","x-davix-h2i-enum":"ImageFormat"},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Encoder quality."},"targetSizeKB":{"type":"integer","minimum":1,"description":"Target size (KB)."},"colorSpace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Color space.","x-davix-h2i-enum":"ColorSpace"},"keepMetadata":{"type":"boolean","description":"Keep metadata."},"progressive":{"type":"boolean","description":"Progressive."},"effort":{"type":"integer","description":"Encoder effort (per-format range)."},"chromaSubsampling":{"type":"string","enum":["4:4:4","4:2:0"],"description":"JPEG chroma subsampling.","x-davix-h2i-enum":"ImagesChromaSubsampling"},"lossless":{"type":"boolean","description":"Lossless."}},"required":["name"]},"description":"Variant definitions (JSON array, max 10). Each variant accepts the same validated fields as /resize + /optimize.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","evidence":"src/processing/images/engine.js:applyVariants"}},"sharedPreprocessing":{"type":"object","properties":{"autoOrient":{"type":"boolean","description":"EXIF auto-orient once."},"crop":{"type":"object","properties":{"x":{"type":"integer"},"y":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"}},"description":"Crop applied once."},"rotate":{"type":"object","properties":{"angle":{"type":"integer"}},"description":"Rotation applied once."},"flip":{"type":"object","properties":{"axis":{"type":"string","enum":["horizontal","vertical"],"x-davix-h2i-enum":"FlipAxis"}},"description":"Flip applied once."}},"description":"Operations applied once to the source before every variant is derived from it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/engine.js:applySharedPreprocessing"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images","variants"]},"encoding":{"variants":{"contentType":"application/json"},"sharedPreprocessing":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"originalName":{"type":"string","nullable":true},"results":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"quality":{"type":"integer","nullable":true}},"required":["name","url","format","sizeBytes","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.variants","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","max_output_dimension_px","max_output_pixels","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/variants\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'variants=[{\"name\":\"x\"}]' \\\n  -F 'output_bundle=zip' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.variants({\n    \"images\": 'photo.jpg',\n    \"variants\": [\n      {\n        \"name\": \"x\"\n      }\n    ],\n    \"output_bundle\": \"zip\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->variants([\n    'images' => 'photo.jpg',\n    'variants' => [[\n            'name' => 'x',\n        ]],\n    'output_bundle' => 'zip',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/images/vectorize":{"post":{"operationId":"images.vectorize","summary":"Trace an image into a vector","description":"Turn a raster image (logo, icon, scan, drawing) into a single-colour SVG or PDF vector with potrace: threshold, despeckle, smoothing, curve tolerance, invert, colour and an optional background. One result per image; counts one file per image.","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"One or more raster images to trace.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"file_type":{"type":"string","enum":["svg","pdf"],"default":"svg","description":"svg (default) or pdf.","x-davix-h2i-enum":"ImagesVectorizeFileType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/vectorize.js"}},"threshold":{"type":"number","minimum":0,"maximum":100,"default":50,"description":"Brightness cut-off, 0-100 (default 50): pixels darker than this become the shape.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/vectorize.js"}},"despeckle":{"type":"integer","minimum":0,"maximum":100,"default":2,"description":"Ignore specks up to this many pixels, 0-100 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/vectorize.js"}},"smoothing":{"type":"number","minimum":0,"maximum":1.34,"default":1,"description":"Corner smoothing, 0 (sharp) to 1.34 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/vectorize.js"}},"tolerance":{"type":"number","minimum":0,"maximum":5,"default":0.2,"description":"Curve optimisation tolerance, 0-5 (default 0.2); higher = fewer nodes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/vectorize.js"}},"invert":{"type":"boolean","default":false,"description":"Trace the light areas instead of the dark ones.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/vectorize.js"}},"color":{"type":"string","format":"color","default":"#000000","description":"Shape colour as #rrggbb (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/vectorize.js"}},"background":{"type":"string","format":"color","description":"SVG only: a background colour as #rrggbb (default none = transparent). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/vectorize.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ originalName, url, format, sizeBytes, width, height, paths }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"originalName":{"type":"string","nullable":true},"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["svg","pdf"]},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"paths":{"type":"integer","nullable":true}},"required":["url","format","sizeBytes","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.vectorize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/vectorize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'file_type=svg' \\\n  -F 'threshold=50' \\\n  -F 'despeckle=2'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.vectorize({\n    \"images\": 'photo.jpg',\n    \"file_type\": \"svg\",\n    \"threshold\": 50,\n    \"despeckle\": 2\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->vectorize([\n    'images' => 'photo.jpg',\n    'file_type' => 'svg',\n    'threshold' => 50,\n    'despeckle' => 2,\n]);\necho $result->requestId;"}]}},"/v1/images/watermark":{"post":{"operationId":"images.watermark","summary":"Watermark an image with text and/or an image overlay","description":"Watermark an image with text and/or an image overlay","tags":["Images"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image file(s) to watermark.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"Accepted types are enforced per upload (the formats registry, set image.input); the number of files and total size are plan/settings limits (runtime), not static contract limits."}},"watermark":{"type":"object","properties":{"text":{"type":"string","description":"Text watermark.","x-davix-h2i-behavior":{"onMissing":"reject","note":"At least one of watermark.text or an uploaded watermarkImage is required (400 missing_field).","evidence":"src/api/images/watermark.js"}},"position":{"type":"string","enum":["center","top-left","top-right","bottom-left","bottom-right","top","bottom","left","right"],"default":"center","description":"Placement.","x-davix-h2i-enum":"WatermarkPosition","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Invalid -> 400 invalid_parameter (validated at the route boundary).","evidence":"src/api/images/watermark.js"}},"opacity":{"type":"number","minimum":0,"maximum":1,"default":0.35,"description":"Overlay opacity.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0,1]; non-numeric -> 0.35.","evidence":"src/processing/images/engine.js:applyWatermark"}},"margin":{"type":"integer","minimum":0,"maximum":5000,"default":24,"description":"Edge margin (px) for non-centered positions.","x-davix-h2i-behavior":{"onOutOfRange":"fallback","onInvalid":"fallback","note":"clampInt(): values outside [0,5000] or non-integers fall back to 24 (they are NOT clamped to the nearest bound).","evidence":"src/processing/images/engine.js:clampInt"}},"scale":{"type":"number","minimum":0.01,"maximum":1,"default":0.25,"description":"Image-overlay size as a fraction of the smaller base dimension.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [0.01,1]; non-numeric -> 0.25.","evidence":"src/processing/images/engine.js:applyWatermark"}},"fontSize":{"type":"integer","minimum":6,"maximum":400,"default":32,"description":"Text size (px).","x-davix-h2i-behavior":{"onOutOfRange":"fallback","onInvalid":"fallback","note":"Outside [6,400] -> 32 (not clamped).","evidence":"src/processing/images/engine.js:applyWatermark"}},"color":{"type":"string","format":"color","default":"#ffffff","description":"Text color. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid hex -> 400.","evidence":"src/processing/shared/watermark-geometry.js:validateHexColor"}},"tile":{"type":"boolean","description":"Repeat the watermark across the whole image.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) or boolean true enables it; any other value = false","note":"A tiling that would need more than 2000 tiles -> 400 (field \"tile\").","evidence":"src/processing/images/engine.js:buildTileGrid"}},"tileSpacing":{"type":"integer","minimum":0,"maximum":2000,"default":20,"description":"Gap between tiles (px).","x-davix-h2i-behavior":{"onOutOfRange":"fallback","onInvalid":"fallback","note":"Outside [0,2000] -> 20 (not clamped).","evidence":"src/processing/images/engine.js:applyWatermark"}},"blendMode":{"type":"string","enum":["clear","source","over","in","out","atop","dest","dest-over","dest-in","dest-out","dest-atop","xor","add","saturate","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion"],"default":"over","description":"How the watermark combines with the picture (multiply, screen, overlay, ...).","x-davix-h2i-enum":"ImagesBlendMode","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unrecognized value -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseWatermarkStyle"}},"rotation":{"type":"number","minimum":-360,"maximum":360,"description":"Rotate the watermark by this many degrees (clockwise). The rotated watermark is kept inside the picture.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -360..360 or not a number -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseWatermarkStyle"}},"shadow":{"type":"object","properties":{"offsetX":{"type":"integer","minimum":-200,"maximum":200,"description":"Horizontal offset in pixels."},"offsetY":{"type":"integer","minimum":-200,"maximum":200,"description":"Vertical offset in pixels."},"blur":{"type":"number","minimum":0,"maximum":50,"description":"Blur radius."},"color":{"type":"string","format":"color","description":"Shadow colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"opacity":{"type":"number","minimum":0,"maximum":1,"description":"Shadow opacity."}},"description":"A drop shadow under the watermark: { offsetX, offsetY, blur, color, opacity } (defaults 4, 4, 4, #000000, 0.5).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown key or a value outside its range -> 400 invalid_parameter.","evidence":"src/processing/images/engine.js:parseWatermarkStyle"}},"fontFamily":{"type":"string","maxLength":100,"description":"Font family (GET /v1/formats lists the installed ones) or a generic name: sans-serif (default), serif, monospace, emoji. Characters the font lacks are drawn from a fallback font that has them (every script, CJK and emoji).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A family that is not installed -> 400 font_unavailable.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"fontWeight":{"type":"string","description":"Weight: thin, light, normal (default), medium, semibold, bold, heavy, or a number 100-900.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything else -> 400 invalid_parameter.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"italic":{"type":"boolean","description":"true = italic (a synthetic slant if the font has none).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"align":{"type":"string","enum":["left","center","right"],"description":"Alignment of wrapped lines: left (default), center, right.","x-davix-h2i-enum":"Align","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"direction":{"type":"string","enum":["auto","ltr","rtl"],"description":"Base text direction: auto (default, from the text), ltr or rtl.","x-davix-h2i-enum":"Direction","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"lang":{"type":"string","description":"Language of the text (ja, ko, zh-CN, zh-TW, ar, fa, ...): chooses the right regional form of Han characters and the right Arabic-script face.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a language tag -> 400 invalid_parameter.","evidence":"src/processing/images/text-render.js:parseTextStyle"}},"letterSpacing":{"type":"number","minimum":-10,"maximum":100,"description":"Extra space between characters in pixels (-10 to 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/images/text-render.js:parseTextStyle"}}},"description":"Watermark options (JSON object). Provide `text` and/or upload `watermarkImage`.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON -> 400 invalid_parameter.","evidence":"src/api/images/shared.js:parseJsonField"}},"watermarkImage":{"type":"string","format":"binary","description":"Overlay image (one file).","x-davix-h2i-behavior":{"note":"A corrupt overlay with no text fails (400); with text it is skipped and reported in `warnings`.","evidence":"src/processing/images/engine.js:applyWatermark"},"x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"output_format":{"type":"string","enum":["jpeg","png","webp","gif","avif","tiff","bmp","ico","apng","jxl","jp2"],"description":"Format of the result: one of the image formats the API can write (GET /v1/formats?direction=output&family=image lists them). Leave it out to keep this endpoint's usual behaviour (the result keeps the input's format).","x-davix-h2i-enum":"ImagesOutputFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased (jpg = jpeg)","note":"Not a writable format -> 400 invalid_parameter with the allowed values. A format the plan does not include -> 403 format_not_allowed.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality of lossy output (JPEG, WebP, AVIF; for TIFF it switches to JPEG compression). With only `quality` the result keeps its own format and is re-encoded at this quality. PNG and GIF are lossless and ignore it.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-100 or not a whole number -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"lossless":{"type":"boolean","description":"true = lossless WebP / AVIF (larger files, pixel-exact).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything but true/false -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"dpi":{"type":"integer","minimum":1,"maximum":1200,"description":"Pixel density written into the result (PNG, JPEG, TIFF, BMP). It does not resample the image; for SVG input it also sets the resolution the vector is drawn at.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside 1-1200 -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"colorspace":{"type":"string","enum":["srgb","grayscale","cmyk"],"description":"Colour handling of the result: srgb, grayscale, or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesColorspace","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; cmyk with a format that cannot hold it -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"icc_profile":{"type":"string","enum":["srgb","p3","cmyk"],"description":"Convert the colours to a standard profile and embed it: srgb, p3 (Display P3) or cmyk (JPEG and TIFF only).","x-davix-h2i-enum":"ImagesIccProfile","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"metadata":{"type":"string","enum":["strip","keep","set"],"default":"strip","description":"What happens to the source's embedded metadata (EXIF, GPS, XMP, colour profile): strip (default) removes everything, keep carries it over, set removes it and writes the fields below.","x-davix-h2i-enum":"ImagesMetadata","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter; strip/keep together with metadata fields -> 400 invalid_parameter. Sending any field below without `metadata` means set.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"background":{"type":"string","format":"color","description":"Colour that replaces transparency when the result format cannot hold it (JPEG, BMP). Default white. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a colour -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"author":{"type":"string","maxLength":1024,"description":"With metadata=set: the author (EXIF Artist).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"copyright":{"type":"string","maxLength":1024,"description":"With metadata=set: the copyright notice (EXIF Copyright).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"description":{"type":"string","maxLength":1024,"description":"With metadata=set: a description (EXIF ImageDescription).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Control characters or more than 1024 characters -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_latitude":{"type":"number","minimum":-90,"maximum":90,"description":"With metadata=set: GPS latitude in decimal degrees (south is negative). Needs gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -90..90, or sent without gps_longitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_longitude":{"type":"number","minimum":-180,"maximum":180,"description":"With metadata=set: GPS longitude in decimal degrees (west is negative). Needs gps_latitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -180..180, or sent without gps_latitude -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"gps_altitude":{"type":"number","minimum":-1000,"maximum":100000,"description":"With metadata=set: GPS altitude in metres above sea level. Needs gps_latitude and gps_longitude.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside -1000..100000, or sent without a position -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"exif":{"type":"object","description":"With metadata=set: more EXIF text tags as a JSON object, e.g. {\"Software\":\"My App\",\"DateTimeOriginal\":\"2026:01:02 03:04:05\"}. Allowed tags: Make, Model, Software, Artist, Copyright, ImageDescription, DateTime, DateTimeOriginal, DateTimeDigitized, UserComment, LensModel, LensMake.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON, a tag outside the list, or a value that is not text -> 400 invalid_parameter.","evidence":"src/processing/images/output.js:parseOutputOptions"}},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"images\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["images"]},"encoding":{"watermark":{"contentType":"application/json"},"exif":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ImageResult"}],"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"}}}}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","dimension_exceeded","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","image_processing_failed","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"images","minFiles":1,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":true,"either":false},"x-davix-h2i-id":"images.watermark","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"image","rateLimitCategory":"image","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","max_dimension_px","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/images/watermark\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'images=@photo.jpg' \\\n  -F 'output_bundle=zip' \\\n  -F 'output_format=jpeg' \\\n  -F 'quality=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.images.watermark({\n    \"images\": 'photo.jpg',\n    \"output_bundle\": \"zip\",\n    \"output_format\": \"jpeg\",\n    \"quality\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->images()->watermark([\n    'images' => 'photo.jpg',\n    'output_bundle' => 'zip',\n    'output_format' => 'jpeg',\n    'quality' => 1,\n]);\necho $result->requestId;"}]}},"/v1/jobs":{"get":{"operationId":"jobs","summary":"List the authenticated customer's async jobs","description":"List the authenticated customer's async jobs","tags":["Jobs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [1,200]; non-numeric -> 50.","evidence":"src/platform/jobs/job-service.js:listJobsForCustomer"}},"description":"Maximum jobs returned."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"max(1, parseInt(page) || 1).","evidence":"src/api/jobs/list.js"}},"description":"1-based page. The answer carries `total` and `has_more`."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","page","limit","total","has_more"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"jobs","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/jobs?limit=50&page=1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.jobs.list({\n    \"limit\": 50,\n    \"page\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->jobs()->list([\n    'limit' => 50,\n    'page' => 1,\n]);\necho $result->requestId;"}]}},"/v1/jobs/{id}":{"get":{"operationId":"jobs._id_","summary":"Poll a job's status/progress/result","description":"Poll a job's status/progress/result","tags":["Jobs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Job id (from the async response job_id)."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"$ref":"#/components/schemas/Job"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["job"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","job_not_found","key_expired"],"x-davix-h2i-id":"jobs.{id}","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/jobs/1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.jobs.get({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->jobs()->get([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/jobs/{id}/cancel":{"post":{"operationId":"jobs._id_.cancel","summary":"Cancel a still-queued job. A job already running/completed cannot be cancelled.","description":"Cancel a still-queued job. A job already running/completed cannot be cancelled.","tags":["Jobs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Job id."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"$ref":"#/components/schemas/Job"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["job"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","job_not_cancellable","job_not_found","key_expired"],"x-davix-h2i-id":"jobs.{id}.cancel","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/jobs/1/cancel\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.jobs.cancel({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->jobs()->cancel([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/key/verify":{"get":{"operationId":"key.verify","summary":"Verify the caller's own API key and return its plan/entitlement state","description":"Verify the caller's own API key and return its plan/entitlement state","tags":["Meta"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"string"},"key_type":{"type":"string","enum":["customer","public","owner"]},"plan_slug":{"type":"string","nullable":true},"plan_name":{"type":"string","nullable":true},"customer_email":{"type":"string","nullable":true},"allowed_endpoints":{"$ref":"#/components/schemas/EndpointAccess"},"usage":{"allOf":[{"$ref":"#/components/schemas/UsageSummary"}],"nullable":true,"description":"customer keys only; null when the summary could not be read."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["ok","status","key_type"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"key.verify","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/key/verify\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.keys.verify();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->keys()->verify();\necho $result->requestId;"}]}},"/v1/keys":{"get":{"operationId":"keys","summary":"List the authenticated customer's own API key(s). Metadata only -- prefix/last4/label/status/plan/dates, never the stored secret.","description":"List the authenticated customer's own API key(s). Metadata only -- prefix/last4/label/status/plan/dates, never the stored secret.","tags":["Keys"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"unit":{"type":"string"},"period":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/Key"}},"max_keys":{"type":"integer","nullable":true,"description":"The most API keys the plan allows (the keys you can see; Studio sign-in keys are not counted)."},"ai":{"type":"object","nullable":true,"description":"Only on a plan whose AI has a budget of its own: unit (percent) and allowance (100, the whole of the plan's AI)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["unit","period","results"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"keys","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/keys\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.keys.list();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->keys()->list();\necho $result->requestId;"}]},"post":{"operationId":"keys.post","summary":"Create an additional self-service API key for the authenticated customer. Inherits the plan of the key used to authenticate. The new plaintext secret is returned exactly once, in this response.","description":"Create an additional self-service API key for the authenticated customer. Inherits the plan of the key used to authenticate. The new plaintext secret is returned exactly once, in this response.","tags":["Keys"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","nullable":true,"maxLength":191,"description":"Optional label for the new key.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","normalization":"trimmed; blank -> null","note":"Non-string or longer than 191 characters -> 400.","evidence":"src/api/keys/create.js"}},"expires_at":{"type":"string","nullable":true,"format":"date-time","description":"Optional. The key stops working at this time (UTC) and stays in your key list marked Expired until you delete it. At most 3650 days from now.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a date, in the past, or too far away -> 400 invalid_parameter. Send either expires_at or expires_in_days, not both.","evidence":"src/api/keys/create.js"}},"expires_in_days":{"type":"integer","nullable":true,"minimum":1,"maximum":3650,"description":"Optional. Same as expires_at, as a number of days from now.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number from 1 to 3650 -> 400 invalid_parameter.","evidence":"src/api/keys/create.js"}},"quota_limit":{"type":"integer","nullable":true,"minimum":1,"description":"Optional. The most units this key may use, in your plan's unit (files or requests). It is taken from your shared plan quota, so it can not be more than the plan's total. When the key reaches it, its requests are refused with 429 key_quota_exceeded while your other keys keep working.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Not a whole number of 1 or more, or more than the plan's total -> 400 invalid_parameter.","evidence":"src/api/keys/create.js"}},"ai_limit":{"type":"number","nullable":true,"minimum":1,"maximum":100,"description":"Optional, and only on a plan whose AI has a budget of its own. The most of your plan's AI this key may use, as a percentage from 1 to 100. When the key reaches it, its AI requests are refused with 429 while your other keys keep working.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Sent on a plan without an AI budget of its own, below 1 or above 100 -> 400 invalid_parameter.","evidence":"src/api/keys/create.js"}}}}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Key"}],"type":"object","properties":{"key":{"type":"string","description":"The full API key. Shown ONLY in this response."},"message":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["key","message"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","key_limit_reached"],"x-davix-h2i-id":"keys.post","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/keys\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"expires_in_days\":1,\"quota_limit\":1,\"ai_limit\":1}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.keys.create({\n    \"expires_in_days\": 1,\n    \"quota_limit\": 1,\n    \"ai_limit\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->keys()->create([\n    'expires_in_days' => 1,\n    'quota_limit' => 1,\n    'ai_limit' => 1,\n]);\necho $result->requestId;"}]}},"/v1/keys/{id}":{"delete":{"operationId":"keys._id_.delete","summary":"Delete one of the customer's own API keys, at any time (expired or not)","description":"Delete one of the customer's own API keys, at any time (expired or not)","tags":["Keys"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Key id."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"deleted":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["id","deleted"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","key_not_found"],"x-davix-h2i-id":"keys.{id}.delete","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X DELETE \"$DAVIX_H2I_URL/v1/keys/1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.keys.delete({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->keys()->delete([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/keys/{id}/revoke":{"post":{"operationId":"keys._id_.revoke","summary":"Revoke (disable) the authenticated customer's own API key. Irreversible from the customer's side; if this is their only key they will not be able to authenticate again afterwards.","description":"Revoke (disable) the authenticated customer's own API key. Irreversible from the customer's side; if this is their only key they will not be able to authenticate again afterwards.","tags":["Keys"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Key id."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"status":{"type":"string","enum":["disabled"]},"already_revoked":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["id","status"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","key_not_found","revoke_failed"],"x-davix-h2i-id":"keys.{id}.revoke","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/keys/1/revoke\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.keys.revoke({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->keys()->revoke([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/keys/{id}/rotate":{"post":{"operationId":"keys._id_.rotate","summary":"Rotate the authenticated customer's own API key. Generates a fresh secret for the same key row; the old secret stops working immediately. The new plaintext is returned exactly once, in this response.","description":"Rotate the authenticated customer's own API key. Generates a fresh secret for the same key row; the old secret stops working immediately. The new plaintext is returned exactly once, in this response.","tags":["Keys"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Key id (from GET /v1/keys)."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"key":{"type":"string","description":"The new full API key. Shown ONLY in this response."},"key_prefix":{"type":"string"},"key_last4":{"type":"string","nullable":true},"message":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["id","key","key_prefix","message"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","key_not_found","rotate_failed"],"x-davix-h2i-id":"keys.{id}.rotate","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/keys/1/rotate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.keys.rotate({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->keys()->rotate([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/limits":{"get":{"operationId":"limits","summary":"The limits that apply to the calling key right now, per endpoint","description":"Files per request, total and per-file upload size, the largest result the key may ask for (pixels, resolution), render and PDF page caps and timeouts, for every endpoint that has them. Limits are set per plan and per endpoint and can change at any time, so read them here instead of hard-coding numbers: fields whose limit is not a constant carry a `dynamicLimit` pointing to this endpoint. A customer key sees its plan's values; shared keys see the platform's. `null` means no limit.","tags":["Limits"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"endpoint","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An id or path that has no limits to report -> 404 not_found.","evidence":"src/api/limits/get.js"}},"description":"Only this endpoint (its id, such as images.resize, or its path). Omit for every endpoint."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"key_type":{"type":"string","enum":["customer","public","owner"]},"plan":{"type":"object","properties":{"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"nullable":true,"description":"customer keys only."},"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/EndpointLimits"}},"plans":{"type":"array","items":{"type":"object"},"nullable":true,"description":"Customer keys: the plans in order, smallest first (slug, name, tier, total). A screen can show the endpoints a plan does not include, with the plan that unlocks them."},"my_plan":{"type":"string","nullable":true},"upgrade_url":{"type":"string","nullable":true,"description":"Customer keys: the page where a plan is upgraded or renewed; null when none is set."},"groups":{"type":"array","items":{"type":"object"},"nullable":true,"description":"Customer keys: the titles of the groups an item can belong to, in display order (id, label)."},"allowance":{"type":"object","additionalProperties":true,"nullable":true,"description":"Customer keys: the plan's allowance and how much of it is used this period. total (null = none), used, unit (files or requests), overage (block, or allow when the total is soft: the plan keeps working past it) and over (how far past the total, when soft), operations (id, label, enabled, mode shared|own|capped, separate, limit, used, remaining), endpoints that differ (enabled, cost, cap, used, remaining), shared pool, retention and simple (true when every operation shares one total). extra_credits, only while there are some: remaining, next_expiry and grants (remaining, expires_at) given on top of the plan and used when it cannot cover a request."},"saved":{"type":"object","properties":{"presets":{"type":"object","properties":{"max":{"type":"integer","nullable":true,"description":"Most saved presets (null = no plan limit)."},"endpoints":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Endpoint ids presets can be saved for (null = every endpoint)."}}},"templates":{"type":"object","properties":{"max":{"type":"integer","nullable":true,"description":"Most saved templates (null = no plan limit)."},"max_kb":{"type":"integer"},"endpoints":{"type":"array","items":{"type":"string"}}},"required":["max_kb","endpoints"]}},"required":["presets","templates"],"nullable":true,"description":"Customer keys only: what your plan lets you keep."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["key_type","endpoints"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"limits","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/limits?endpoint=example\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.limits.get({\n    \"endpoint\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->limits()->get([\n    'endpoint' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/notifications":{"get":{"operationId":"notifications","summary":"List the authenticated customer's notifications","description":"List the authenticated customer's notifications","tags":["Notifications"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"reject","note":"Non-numeric or < 1 -> 400 invalid_parameter; values above 100 are clamped to 100.","evidence":"src/api/notifications/list.js; src/platform/notifications/notification-repository.js"}},"description":"Maximum notifications returned."},{"name":"unread","in":"query","required":false,"schema":{"type":"boolean","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/api/notifications/list.js"}},"description":"Only unread notifications."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"max(1, parseInt(page) || 1).","evidence":"src/api/notifications/list.js"}},"description":"1-based page. The answer carries `total` and `has_more`."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"unread_count":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["notifications","unread_count","page","limit","total","has_more"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired"],"x-davix-h2i-id":"notifications","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/notifications?limit=20&unread=true&page=1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.notifications.list({\n    \"limit\": 20,\n    \"unread\": true,\n    \"page\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->notifications()->list([\n    'limit' => 20,\n    'unread' => true,\n    'page' => 1,\n]);\necho $result->requestId;"}]}},"/v1/notifications/{id}":{"delete":{"operationId":"notifications._id_.delete","summary":"Delete one of the customer's notifications","description":"Deletes the notification for good: it leaves the database and the notification menu. Only the customer's own notifications; anything else is 404 not_found.","tags":["Notifications"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Notification id."}],"responses":{"200":{"description":"The id and deleted: true.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"deleted":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["id","deleted"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","not_found"],"x-davix-h2i-id":"notifications.{id}.delete","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X DELETE \"$DAVIX_H2I_URL/v1/notifications/1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.notifications.delete({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->notifications()->delete([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/notifications/{id}/read":{"post":{"operationId":"notifications._id_.read","summary":"Mark one notification as read","description":"Mark one notification as read","tags":["Notifications"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Notification id."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"read":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["id","read"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","not_found"],"x-davix-h2i-id":"notifications.{id}.read","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/notifications/1/read\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.notifications.read({\n    \"id\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->notifications()->read([\n    'id' => 1,\n]);\necho $result->requestId;"}]}},"/v1/notifications/preferences":{"get":{"operationId":"notifications.preferences","summary":"Which notifications you receive","description":"Which notifications you receive","tags":["Notifications"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"array","items":{"type":"object"},"description":"One entry per notification type: type, label, hint, enabled, configurable."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["preferences"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"notifications.preferences","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/notifications/preferences\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.notifications.getPreferences();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->notifications()->getPreferences();\necho $result->requestId;"}]},"put":{"operationId":"notifications.preferences.put","summary":"Switch notification types on or off","description":"Switch notification types on or off","tags":["Notifications"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"quota.warning":{"type":"boolean","description":"quota.warning: true = send, false = do not send.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A non-boolean value -> 400 invalid_parameter.","evidence":"src/api/notifications/preferences.js"}},"job.completed":{"type":"boolean","description":"job.completed: true = send, false = do not send.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A non-boolean value -> 400 invalid_parameter.","evidence":"src/api/notifications/preferences.js"}},"job.failed":{"type":"boolean","description":"job.failed: true = send, false = do not send.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A non-boolean value -> 400 invalid_parameter.","evidence":"src/api/notifications/preferences.js"}}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"array","items":{"type":"object"},"description":"One entry per notification type: type, label, hint, enabled, configurable."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["preferences"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired"],"x-davix-h2i-id":"notifications.preferences.put","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X PUT \"$DAVIX_H2I_URL/v1/notifications/preferences\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"quota.warning\":true,\"job.completed\":true,\"job.failed\":true}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.notifications.updatePreferences({\n    \"quota.warning\": true,\n    \"job.completed\": true,\n    \"job.failed\": true\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->notifications()->updatePreferences([\n    'quota.warning' => true,\n    'job.completed' => true,\n    'job.failed' => true,\n]);\necho $result->requestId;"}]}},"/v1/notifications/read-all":{"post":{"operationId":"notifications.read-all","summary":"Mark every unread notification as read","description":"Mark every unread notification as read","tags":["Notifications"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"updated_count":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["updated_count"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"notifications.read-all","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/notifications/read-all\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.notifications.readAll();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->notifications()->readAll();\necho $result->requestId;"}]}},"/v1/pdfs/annotations":{"post":{"operationId":"pdfs.annotations","summary":"PDF annotations","description":"List the comments, highlights, notes and links in a PDF, remove the ones you pick, or flatten them into the page so they can no longer be edited.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["list","remove","flatten"],"example":"list","description":"list, remove (a new file without the chosen annotations) or flatten (draw them into the page).","x-davix-h2i-enum":"PdfsAnnotationsOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"pages":{"type":"string","example":"1-3","description":"Which pages: all (default), first, last, odd, even, or numbers and ranges such as \"1,3-5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"types":{"type":"array","example":"[\"highlight\"]","items":{"type":"string"},"description":"Only these kinds, for example [\"highlight\",\"text\",\"link\"]. Any kind a PDF has works: highlight, underline, strikeout, text, freetext, link, stamp, ink, square, circle, line, fileattachment.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"ids":{"type":"array","example":"[\"p1-2\"]","items":{"type":"string"},"description":"Only these annotations, by the ids operation=list gives, for example [\"p1-2\"] (page 1, second annotation).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"author":{"type":"string","example":"Alex","description":"Only the annotations written by this author (exact name, any case).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"include_links":{"type":"boolean","default":true,"description":"list: true (default) also lists links. false leaves them out (documents have many).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"limit":{"type":"integer","minimum":1,"maximum":5000,"default":500,"description":"list: at most this many annotations (default 500, up to 5000). The answer says truncated when there are more.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"level":{"type":"string","enum":["all","print","screen"],"default":"all","description":"flatten: all (default), print (only what prints) or screen (only what shows on screen).","x-davix-h2i-enum":"PdfsLevel","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","operation"]},"encoding":{"types":{"contentType":"application/json"},"ids":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"list: { operation, count, byType, annotations: [{ id, page, type, contents, author, modified, color, rect, uri?, hidden, printable }], truncated }. remove / flatten: { url, sizeBytes, operation, removed? / annotationsBefore? }.","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string"},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"count":{"type":"integer"},"byType":{"type":"object","description":"How many annotations of each type (list)."},"annotations":{"type":"array","items":{"type":"object"},"description":"list: one record per annotation with id, page, type, contents, author, modified, color, rect, uri (links), hidden and printable."},"truncated":{"type":"boolean"},"removed":{"type":"integer","description":"remove: how many annotations were removed."},"note":{"type":"string"},"level":{"type":"string"},"annotationsBefore":{"type":"integer","description":"flatten: how many annotations the file had."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["operation"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.annotations","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/annotations\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=list' \\\n  -F 'pages=1-3' \\\n  -F 'types=[\"highlight\"]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.annotations({\n    \"file\": 'document.pdf',\n    \"operation\": \"list\",\n    \"pages\": \"1-3\",\n    \"types\": \"[\\\"highlight\\\"]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->annotations([\n    'file' => 'document.pdf',\n    'operation' => 'list',\n    'pages' => '1-3',\n    'types' => '[\"highlight\"]',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/attachments":{"post":{"operationId":"pdfs.attachments","summary":"List, add, extract, or remove PDF embedded-file attachments","description":"List, add, extract, or remove PDF embedded-file attachments","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["list","add","extract","remove"],"description":"Attachment operation.","x-davix-h2i-enum":"PdfsAttachmentsOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/attachments.js"}},"key":{"type":"string","pattern":"^[A-Za-z0-9._-]{1,128}$","description":"Attachment key (see operation=list).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"1-128 characters from [A-Za-z0-9._-]; required for extract/remove.","evidence":"src/processing/pdfs/engine.js:assertSafeAttachmentKey"},"x-davix-h2i-required-when":[{"field":"operation","in":["extract","remove"]}]},"attachment":{"type":"string","format":"binary","description":"The file to embed (operation=add).","x-davix-h2i-required-when":[{"field":"operation","equals":"add"}],"x-davix-h2i-file":{"note":"Any file type; size limits are plan/settings limits."}},"filename":{"type":"string","pattern":"^[A-Za-z0-9._-]{1,128}$","description":"Stored attachment name (default: the uploaded file name).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:addAttachment"},"x-davix-h2i-depends-on":[{"field":"operation","equals":"add"}]},"mimetype":{"type":"string","description":"Attachment MIME type (default: the uploaded file type).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Must be a valid MIME type.","evidence":"src/processing/pdfs/engine.js:addAttachment"},"x-davix-h2i-depends-on":[{"field":"operation","equals":"add"}]},"description":{"type":"string","maxLength":500,"description":"Attachment description.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","note":"Truncated to 500 characters.","evidence":"src/processing/pdfs/engine.js:addAttachment"},"x-davix-h2i-depends-on":[{"field":"operation","equals":"add"}]},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","operation"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"attachmentCount":{"type":"integer"},"attachments":{"type":"array","items":{"type":"object"},"description":"Each entry: key, filename and file details."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["attachmentCount","attachments"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"key":{"type":"string"},"filename":{"type":"string"},"sizeBytes":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url"]}],"description":"operation=list -> {attachmentCount,attachments[]}; add -> {url,key,filename}; extract -> {url,sizeBytes}; remove -> {url}."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-actions":{"selector":"operation","style":"enum-field","items":[{"name":"list","fields":[]},{"name":"add","fields":["attachment","filename","mimetype","description"],"requiredFields":["attachment"]},{"name":"extract","fields":["key"],"requiredFields":["key"]},{"name":"remove","fields":["key"],"requiredFields":["key"]}]},"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.attachments","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/attachments\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=list' \\\n  -F 'output_bundle=zip' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.attachments({\n    \"file\": 'document.pdf',\n    \"operation\": \"list\",\n    \"output_bundle\": \"zip\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->attachments([\n    'file' => 'document.pdf',\n    'operation' => 'list',\n    'output_bundle' => 'zip',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/auto-rotate":{"post":{"operationId":"pdfs.auto-rotate","summary":"Auto-rotate pages","description":"Turn sideways and upside-down scanned pages upright: the text of each page is read to find its orientation, or every wide (or tall) page is turned a quarter.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to straighten.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to check: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/auto-rotate.js"}},"mode":{"type":"string","enum":["osd","portrait","landscape"],"default":"osd","description":"osd (default): detect the orientation from the text (needs text on the page). portrait: turn every page that is wider than tall. landscape: turn every page that is taller than wide.","x-davix-h2i-enum":"PdfsAutoRotateMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/auto-rotate.js"}},"min_confidence":{"type":"number","minimum":0,"maximum":100,"default":2,"description":"With mode=osd: a page is only turned when the detection is at least this sure, 0 to 100 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/auto-rotate.js"}},"direction":{"type":"string","enum":["clockwise","counterclockwise"],"default":"clockwise","description":"With portrait or landscape: turn clockwise (default) or counterclockwise.","x-davix-h2i-enum":"PdfsDirection","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/auto-rotate.js"}},"dpi":{"type":"integer","minimum":72,"maximum":400,"default":150,"description":"With mode=osd: the resolution the pages are drawn at, 72 to 400 (default 150).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/auto-rotate.js"}},"dry_run":{"type":"boolean","default":false,"description":"true: do not turn anything; the answer says which pages would be turned (wouldRotate). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/auto-rotate.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, mode, rotated, wouldRotate, changed, pages: [{ page, turn, applied, rotationBefore, rotationAfter, confidence?, script?, reason? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"mode":{"type":"string","enum":["osd","portrait","landscape"]},"rotated":{"type":"integer"},"wouldRotate":{"type":"integer"},"changed":{"type":"boolean"},"pages":{"type":"array","items":{"type":"object"},"description":"Every page checked: page, turn (degrees clockwise: 0, 90, 180, 270), applied, rotationBefore, rotationAfter, confidence and script (osd) and a reason when it was left as it is."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","mode","rotated","wouldRotate","changed","pages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.auto-rotate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/auto-rotate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=1-3' \\\n  -F 'mode=osd' \\\n  -F 'min_confidence=2'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.autoRotate({\n    \"file\": 'document.pdf',\n    \"pages\": \"1-3\",\n    \"mode\": \"osd\",\n    \"min_confidence\": 2\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->autoRotate([\n    'file' => 'document.pdf',\n    'pages' => '1-3',\n    'mode' => 'osd',\n    'min_confidence' => 2,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/bates":{"post":{"operationId":"pdfs.bates","summary":"Bates numbering","description":"Stamp a running identifier on every page of a PDF, such as ACME-000123: a prefix, a number padded with zeros and a suffix, at the corner you choose, as courts and law firms number evidence.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"prefix":{"type":"string","maxLength":40,"example":"ACME-","description":"Text before the number, for example \"ACME-\" (letters, digits and common punctuation, up to 40 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"suffix":{"type":"string","maxLength":40,"description":"Text after the number, for example \"-CONF\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"start":{"type":"integer","minimum":0,"maximum":999999999,"default":1,"description":"The number on the first numbered page (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"step":{"type":"integer","minimum":1,"maximum":1000,"default":1,"description":"How much the number grows from page to page (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"digits":{"type":"integer","minimum":1,"maximum":12,"default":6,"description":"How many digits the number is padded to with zeros (default 6: 000123).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"position":{"type":"string","enum":["bottom-right","bottom-left","bottom-center","top-right","top-left","top-center"],"default":"bottom-right","description":"Where the label goes: bottom-right (default), bottom-left, bottom-center, top-right, top-left or top-center.","x-davix-h2i-enum":"PdfsBatesPosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"font_size":{"type":"number","minimum":6,"maximum":36,"default":10,"description":"The size of the label in points (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"margin":{"type":"number","minimum":0,"maximum":200,"default":24,"description":"The distance from the page edge in points (default 24).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"color":{"type":"string","format":"color","default":"#000000","description":"The text colour as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"The label background: a hex colour (default #ffffff, so the number reads on any page) or none. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"pages":{"type":"string","example":"2-10","description":"Which pages to number: all (default), first, last, odd, even, or numbers and ranges such as \"2-10\". Only these pages get a number and the numbers run over them.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/bates.js"}},"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, pagesNumbered, pages, first, last }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"pagesNumbered":{"type":"integer"},"pages":{"type":"integer","description":"How many pages the PDF has."},"first":{"type":"string","description":"The first label, for example ACME-000001."},"last":{"type":"string","description":"The last label."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","pagesNumbered","pages","first","last"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.bates","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/bates\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'prefix=ACME-' \\\n  -F 'start=1' \\\n  -F 'step=1' \\\n  -F 'file=@document.pdf'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.bates({\n    \"prefix\": \"ACME-\",\n    \"start\": 1,\n    \"step\": 1,\n    \"file\": 'document.pdf'\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->bates([\n    'prefix' => 'ACME-',\n    'start' => 1,\n    'step' => 1,\n    'file' => 'document.pdf',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/bookmarks":{"post":{"operationId":"pdfs.bookmarks","summary":"Bookmarks, table of contents and page labels","description":"list: read the bookmarks; set: write a bookmark tree; clear: remove them; toc: insert a table-of-contents page with links built from the bookmarks (or a tree you send); labels: set page labels such as i, ii, iii then 1, 2, 3.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["list","set","clear","toc","labels"],"description":"list, set, clear, toc or labels.","x-davix-h2i-enum":"PdfsBookmarksOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"bookmarks":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"page":{"type":"integer","minimum":1}},"required":["title","page"],"additionalProperties":true},"description":"set / toc: the tree [{ \"title\": \"Intro\", \"page\": 1, \"children\": [...] }] (page is 1-based, up to 8 levels, 5000 items).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"labels":{"type":"array","items":{"type":"object","properties":{"from":{"type":"integer","minimum":1}},"required":["from"],"additionalProperties":true},"description":"labels: ranges [{ \"from\": 1, \"style\": \"roman-lower\", \"prefix\": \"\", \"start\": 1 }]; style is decimal, roman-upper, roman-lower, alpha-upper, alpha-lower or none.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"toc_title":{"type":"string","description":"toc: the heading of the contents page (default Contents).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"toc_depth":{"type":"integer","minimum":1,"maximum":8,"default":3,"description":"toc: deepest bookmark level to list (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","operation"]},"encoding":{"bookmarks":{"contentType":"application/json"},"labels":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, operation, bookmarksWritten? | cleared? | tocPages, entries | labelRanges } for set / clear / toc / labels; { operation: \"list\", pages, count, bookmarks: [{ title, page, children }] } for list.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"operation":{"type":"string"},"bookmarksWritten":{"type":"integer"},"cleared":{"type":"boolean"},"tocPages":{"type":"integer"},"entries":{"type":"integer"},"labelRanges":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","operation"]},{"type":"object","properties":{"operation":{"type":"string"},"pages":{"type":"integer"},"count":{"type":"integer"},"bookmarks":{"type":"array","items":{"type":"object"},"description":"The tree: title, page (1-based or null), children."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["operation","pages","count","bookmarks"]}]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.bookmarks","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/bookmarks\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=list' \\\n  -F 'toc_depth=3' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.bookmarks({\n    \"file\": 'document.pdf',\n    \"operation\": \"list\",\n    \"toc_depth\": 3,\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->bookmarks([\n    'file' => 'document.pdf',\n    'operation' => 'list',\n    'toc_depth' => 3,\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/compare":{"post":{"operationId":"pdfs.compare","summary":"Compare two PDFs: line-level text diff or per-page visual diff","description":"Compare two PDFs: line-level text diff or per-page visual diff","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"fileA":{"type":"string","format":"binary","description":"The first PDF.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage."}},"fileB":{"type":"string","format":"binary","description":"The second PDF.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage."}},"mode":{"type":"string","enum":["text","visual","pages"],"default":"text","description":"text = line diff of the text layers; visual = per-page image diff; pages = one line per page: identical, changed (text lines and share of pixels) or present in one file only.","x-davix-h2i-enum":"PdfsCompareMode","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/pdfs/compare.js"}},"pages":{"type":"string","pattern":"^(all|first|\\s*\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*\\s*)$","default":"all","description":"Pages: \"all\", \"first\", or a comma list of pages/ranges such as \"1,3-5\" (1-based). Default = all pages.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Lenient parser: out-of-range pages are dropped/clamped to the document; if nothing valid remains the result falls back to page 1 (it does NOT return an error).","evidence":"src/processing/pdfs/engine.js:parsePageNumbers"}},"dpi":{"type":"integer","minimum":30,"maximum":300,"default":100,"description":"Resolution for mode=visual.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [30,300] -> 400.","evidence":"src/processing/pdfs/engine.js:comparePdfs"},"x-davix-h2i-depends-on":[{"field":"mode","equals":"visual"}]},"threshold":{"type":"number","minimum":0,"maximum":1,"default":0.1,"description":"visual / pages: colour tolerance per pixel, 0 (exact) to 1 (very tolerant); default 0.1.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:comparePdfsVisual"}},"region":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"}},"required":["x","y","width","height"],"description":"visual / pages: compare only this area of every page: { x, y, width, height } in points from the top-left.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:comparePdfsVisual"}},"sideBySide":{"type":"boolean","description":"Also return a side-by-side image for changed pages (mode=visual).","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/processing/pdfs/engine.js:comparePdfs"},"x-davix-h2i-depends-on":[{"field":"mode","equals":"visual"}]},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"fileA_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the \"fileA\" input from this public http(s) address instead of uploading it. For each input send either the file or its URL, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"fileB_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the \"fileB\" input from this public http(s) address instead of uploading it. For each input send either the file or its URL, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["fileA","fileB"]},"encoding":{"region":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["text"]},"identical":{"type":"boolean"},"pageCountA":{"type":"integer"},"pageCountB":{"type":"integer"},"linesAdded":{"type":"integer"},"linesRemoved":{"type":"integer"},"hunks":{"type":"array","items":{"type":"object","properties":{"added":{"type":"boolean"},"removed":{"type":"boolean"},"value":{"type":"string"}},"required":["added","removed","value"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["mode","identical","pageCountA","pageCountB","linesAdded","linesRemoved","hunks"]},{"type":"object","properties":{"mode":{"type":"string","enum":["visual"]},"identical":{"type":"boolean"},"pageCountA":{"type":"integer"},"pageCountB":{"type":"integer"},"pages":{"type":"array","items":{"type":"object","properties":{"pageNumber":{"type":"integer"},"identical":{"type":"boolean"},"reason":{"type":"string"},"diffPixelCount":{"type":"integer"},"diffPercent":{"type":"number"},"diffImageUrl":{"type":"string","format":"uri"},"sideBySideUrl":{"type":"string","format":"uri"}},"required":["pageNumber","identical"],"additionalProperties":true}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["mode","identical","pageCountA","pageCountB","pages"]},{"type":"object","properties":{"mode":{"type":"string","enum":["pages"]},"identical":{"type":"boolean"},"pageCountA":{"type":"integer"},"pageCountB":{"type":"integer"},"changedPages":{"type":"array","items":{"type":"integer"}},"pages":{"type":"array","items":{"type":"object","properties":{"pageNumber":{"type":"integer"},"status":{"type":"string","enum":["identical","changed","only_in_one_file"]},"textLinesAdded":{"type":"integer"},"textLinesRemoved":{"type":"integer"},"diffPercent":{"type":"number"},"reason":{"type":"string"}},"required":["pageNumber","status","textLinesAdded","textLinesRemoved"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["mode","identical","pageCountA","pageCountB","changedPages","pages"]}]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"fixed","field":"fileA","minFiles":2,"ceiling":2,"directFiles":1,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"pdfs.compare","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/compare\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'fileA=@document.pdf' \\\n  -F 'fileB=@document.pdf' \\\n  -F 'mode=text' \\\n  -F 'dpi=100' \\\n  -F 'threshold=0.1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.compare({\n    \"fileA\": 'document.pdf',\n    \"fileB\": 'document.pdf',\n    \"mode\": \"text\",\n    \"dpi\": 100,\n    \"threshold\": 0.1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->compare([\n    'fileA' => 'document.pdf',\n    'fileB' => 'document.pdf',\n    'mode' => 'text',\n    'dpi' => 100,\n    'threshold' => 0.1,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/cover":{"post":{"operationId":"pdfs.cover","summary":"Add a cover page","description":"Put a cover page in front of a PDF, with a title, subtitle, author, date, extra lines and an optional image, in any script, on a page the size of the first page.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"image":{"type":"string","format":"binary","description":"An image (PNG, JPEG, WebP ...) for the cover.","x-davix-h2i-file":{"note":"Scaled to fit; never enlarged."}},"title":{"type":"string","description":"The title.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"subtitle":{"type":"string","description":"The subtitle.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"author":{"type":"string","description":"The author line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"date":{"type":"string","description":"The date line (any text).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"lines":{"type":"array","items":{"type":"string"},"description":"Up to 20 more lines (a JSON array or text with line breaks).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"background":{"type":"string","format":"color","description":"Cover colour, e.g. #f4efe6. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"align":{"type":"string","enum":["left","center","right"],"default":"center","description":"left, center (default) or right.","x-davix-h2i-enum":"Align","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"size":{"type":"string","description":"A paper size or JSON { width, height } in points (default: the first page of the document).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"fontFamily":{"type":"string","description":"Font family (GET /v1/formats lists installed fonts).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"color":{"type":"string","format":"color","description":"Text colour (default #111111). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"lang":{"type":"string","description":"Language tag for scripts with regional forms.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"direction":{"type":"string","enum":["auto","ltr","rtl"],"description":"auto, ltr or rtl.","x-davix-h2i-enum":"Direction","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"lines":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, pages }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"pages":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","pages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.cover","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/cover\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'align=center' \\\n  -F 'direction=auto' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.cover({\n    \"file\": 'document.pdf',\n    \"align\": \"center\",\n    \"direction\": \"auto\",\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->cover([\n    'file' => 'document.pdf',\n    'align' => 'center',\n    'direction' => 'auto',\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/dark-mode":{"post":{"operationId":"pdfs.dark-mode","summary":"Dark mode PDF","description":"Re-colour a PDF for reading at night: invert it (white on black), soften it (night) or give the paper a warm tint (sepia). Text stays text and vectors stay vectors.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to re-colour.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to re-colour: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dark-mode.js"}},"mode":{"type":"string","enum":["invert","night","sepia"],"default":"invert","description":"invert (default: white text on black), night (inverted with a warm grey text) or sepia (a warm paper tint).","x-davix-h2i-enum":"PdfsDarkModeMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dark-mode.js"}},"strength":{"type":"number","minimum":0,"maximum":100,"default":100,"description":"How strongly the effect is mixed in, 0 to 100 (default 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dark-mode.js"}},"tint":{"type":"string","format":"color","example":"#f1e3c4","description":"With night or sepia: the tint as a hex colour (defaults #d9d4c7 for night, #f1e3c4 for sepia). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dark-mode.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, mode, strength, pages }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"mode":{"type":"string","enum":["invert","night","sepia"]},"strength":{"type":"number"},"pages":{"type":"array","items":{"type":"integer"},"description":"The pages that were re-coloured."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","mode","strength","pages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.dark-mode","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/dark-mode\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=1-3' \\\n  -F 'mode=invert' \\\n  -F 'strength=100'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.darkMode({\n    \"file\": 'document.pdf',\n    \"pages\": \"1-3\",\n    \"mode\": \"invert\",\n    \"strength\": 100\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->darkMode([\n    'file' => 'document.pdf',\n    'pages' => '1-3',\n    'mode' => 'invert',\n    'strength' => 100,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/decode-codes":{"post":{"operationId":"pdfs.decode-codes","summary":"Read codes in a PDF","description":"Read every QR code and barcode on the chosen pages of a PDF (a scan or a document), with the page it is on and where, with the same decoder and symbologies as the picture tool.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to read the codes of.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to read: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/decode-codes.js"}},"dpi":{"type":"integer","minimum":72,"maximum":400,"default":200,"description":"The resolution the pages are drawn at before reading, 72 to 400 (default 200). Small codes need a higher value.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/decode-codes.js"}},"formats":{"type":"array","items":{"type":"string"},"description":"Only read these symbologies (default: all), as a list or comma-separated: qrcode, code128, ean13, datamatrix, pdf417 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/decode-codes.js"}},"try_harder":{"type":"boolean","default":true,"description":"true (default): also look for rotated, small and damaged codes (slower).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/decode-codes.js"}},"unique":{"type":"boolean","default":false,"description":"true: list a code that appears on several pages once (the first page). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/decode-codes.js"}},"include_position":{"type":"boolean","default":false,"description":"true: add the four corners of every code in points of the page. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/decode-codes.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"formats":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ pagesScanned, count, pages: [{ page, count }], codes: [{ page, text, symbology, position? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"pagesScanned":{"type":"integer"},"count":{"type":"integer"},"pages":{"type":"array","items":{"type":"object"},"description":"For every page read: { page, count }."},"codes":{"type":"array","items":{"type":"object"},"description":"Every code: page, text, symbology and, with include_position, position (four { x, y } corners in points)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["pagesScanned","count","pages","codes"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.decode-codes","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/decode-codes\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=1-3' \\\n  -F 'dpi=200' \\\n  -F 'formats=[\"example\"]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.decodeCodes({\n    \"file\": 'document.pdf',\n    \"pages\": \"1-3\",\n    \"dpi\": 200,\n    \"formats\": [\n      \"example\"\n    ]\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->decodeCodes([\n    'file' => 'document.pdf',\n    'pages' => '1-3',\n    'dpi' => 200,\n    'formats' => ['example'],\n]);\necho $result->requestId;"}]}},"/v1/pdfs/dedupe-pages":{"post":{"operationId":"pdfs.dedupe-pages","summary":"Remove duplicate pages","description":"Find the pages of a PDF that look the same as another page (a document scanned twice, a repeated cover) and take the extra copies out, keeping the first or the last; or only report them.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to clean.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to compare: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dedupe-pages.js"}},"similarity":{"type":"number","minimum":50,"maximum":100,"default":98,"description":"How much two pages must look alike to be duplicates, in percent of the marked area, 50 to 100 (default 98).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dedupe-pages.js"}},"keep":{"type":"string","enum":["first","last"],"default":"first","description":"Which copy stays: first (default) or last.","x-davix-h2i-enum":"PdfsKeep","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dedupe-pages.js"}},"consecutive_only":{"type":"boolean","default":false,"description":"true: only a page that looks like the page right before it is a duplicate (a page scanned twice in a row). Default false: any two pages.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dedupe-pages.js"}},"text_check":{"type":"boolean","default":false,"description":"true: two pages are only duplicates when their text is also the same (forms with the same layout and other words are kept). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dedupe-pages.js"}},"dpi":{"type":"integer","minimum":30,"maximum":200,"default":60,"description":"The resolution the pages are drawn at for the comparison, 30 to 200 (default 60).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dedupe-pages.js"}},"dark_level":{"type":"integer","minimum":50,"maximum":250,"default":160,"description":"Pixels darker than this (0-255) count as ink in the comparison (default 160).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dedupe-pages.js"}},"report_only":{"type":"boolean","default":false,"description":"true: do not change the file, only list the duplicates (the original is returned). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/dedupe-pages.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, pagesIn, pagesOut, removed, wouldRemove, changed, pages: [{ page, kept, duplicateOf?, similarity? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"pagesIn":{"type":"integer"},"pagesOut":{"type":"integer"},"removed":{"type":"array","items":{"type":"integer"},"description":"The pages taken out (empty with report_only)."},"wouldRemove":{"type":"array","items":{"type":"integer"},"description":"The pages that are duplicates."},"changed":{"type":"boolean"},"pages":{"type":"array","items":{"type":"object"},"description":"Every page: page, kept, and for a duplicate duplicateOf (the page it repeats) and similarity."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","pagesIn","pagesOut","removed","wouldRemove","changed","pages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.dedupe-pages","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/dedupe-pages\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=1-3' \\\n  -F 'similarity=98' \\\n  -F 'keep=first'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.dedupePages({\n    \"file\": 'document.pdf',\n    \"pages\": \"1-3\",\n    \"similarity\": 98,\n    \"keep\": \"first\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->dedupePages([\n    'file' => 'document.pdf',\n    'pages' => '1-3',\n    'similarity' => 98,\n    'keep' => 'first',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/delete-by-content":{"post":{"operationId":"pdfs.delete-by-content","summary":"Delete pages by content","description":"Take out every page that contains certain words or phrases (separator sheets, \"Intentionally left blank\", a confidential page), or keep only those pages; any or all of the terms.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to clean (it needs a text layer).","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"terms":{"type":"array","example":"[\"Intentionally left blank\",\"CONFIDENTIAL\"]","items":{"type":"string"},"description":"The words or phrases to look for, as a list or comma-separated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/delete-by-content.js"}},"match":{"type":"string","enum":["any","all"],"default":"any","description":"any (default): a page with one of the terms matches. all: the page must contain every term.","x-davix-h2i-enum":"PdfsMatch","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/delete-by-content.js"}},"action":{"type":"string","enum":["delete","keep"],"default":"delete","description":"delete (default): remove the matching pages. keep: keep only the matching pages.","x-davix-h2i-enum":"PdfsAction","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/delete-by-content.js"}},"case_sensitive":{"type":"boolean","default":false,"description":"true: upper and lower case differ. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/delete-by-content.js"}},"whole_word":{"type":"boolean","default":false,"description":"true: a term only matches as a whole word. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/delete-by-content.js"}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to look at; pages outside stay as they are: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/delete-by-content.js"}},"report_only":{"type":"boolean","default":false,"description":"true: do not change the file, only list the matching pages. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/delete-by-content.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","terms"]},"encoding":{"terms":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, action, pagesIn, pagesOut, removed, wouldRemove, changed, pages: [{ page, matched, terms, hasText, remove, reason? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"action":{"type":"string","enum":["delete","keep"]},"pagesIn":{"type":"integer"},"pagesOut":{"type":"integer"},"removed":{"type":"array","items":{"type":"integer"},"description":"The pages taken out (empty with report_only)."},"wouldRemove":{"type":"array","items":{"type":"integer"},"description":"The pages that would be taken out."},"changed":{"type":"boolean"},"pages":{"type":"array","items":{"type":"object"},"description":"Every page: page, matched, the terms found, hasText (false for a page with no text layer) and remove."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","action","pagesIn","pagesOut","removed","wouldRemove","changed","pages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.delete-by-content","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/delete-by-content\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'terms=[\"Intentionally left blank\",\"CONFIDENTIAL\"]' \\\n  -F 'match=any' \\\n  -F 'action=delete'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.deleteByContent({\n    \"file\": 'document.pdf',\n    \"terms\": \"[\\\"Intentionally left blank\\\",\\\"CONFIDENTIAL\\\"]\",\n    \"match\": \"any\",\n    \"action\": \"delete\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->deleteByContent([\n    'file' => 'document.pdf',\n    'terms' => '[\"Intentionally left blank\",\"CONFIDENTIAL\"]',\n    'match' => 'any',\n    'action' => 'delete',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/extract":{"post":{"operationId":"pdfs.extract","summary":"Extract a page range or per-page/per-range documents","description":"Extract a page range or per-page/per-range documents","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to split/extract from.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","pattern":"^(all|first|\\s*\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*\\s*)$","default":"all","description":"Pages: \"all\", \"first\", or a comma list of pages/ranges such as \"1,3-5\" (1-based). Default = all pages.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Lenient parser: out-of-range pages are dropped/clamped to the document; if nothing valid remains the result falls back to page 1 (it does NOT return an error).","evidence":"src/processing/pdfs/engine.js:parsePageNumbers"}},"output":{"type":"string","enum":["single","perPage","perRange"],"default":"single","description":"single = one PDF with the selected pages; perPage = one PDF per page; perRange = one PDF per comma-separated range (requires pages).","x-davix-h2i-enum":"PdfsExtractOutput","x-davix-h2i-behavior":{"onInvalid":"reject","note":"One of single, perPage, perRange. Any other value -> 400 invalid_parameter. perRange without pages -> 400 missing_field.","evidence":"src/processing/pdfs/engine.js:extractPdf"}},"prefix":{"type":"string","maxLength":64,"pattern":"^[A-Za-z0-9._-]{0,64}$","description":"Filename prefix for each produced file.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Used as a file-name prefix, so only letters, digits, dot, underscore and hyphen (max 64) are accepted. Anything else -> 400 invalid_parameter.","evidence":"src/api/pdfs/extract.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return multi-file output as ONE zip download instead of an array of signed URLs (billing is unchanged).","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"ignore","normalization":"lower-cased; any value other than \"zip\" is ignored","evidence":"src/api/pdfs/extract.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri"},"pageCount":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","pageCount"]},{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"page":{"type":"integer"},"range":{"type":"string"}},"required":["url"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["zip"]},"sizeBytes":{"type":"integer"},"fileCount":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","format","sizeBytes","fileCount"]}],"description":"output=single -> {url,pageCount}; perPage/perRange -> {results[]}; output_bundle=zip with several files -> {url,format:\"zip\",sizeBytes,fileCount}."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.extract","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_split_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/extract\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'output=single' \\\n  -F 'output_bundle=zip' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.extract({\n    \"file\": 'document.pdf',\n    \"output\": \"single\",\n    \"output_bundle\": \"zip\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->extract([\n    'file' => 'document.pdf',\n    'output' => 'single',\n    'output_bundle' => 'zip',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/forms":{"post":{"operationId":"pdfs.forms","summary":"Fill/flatten/list/create AcroForm fields","description":"Fill/flatten/list/create AcroForm fields","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF form.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"data":{"type":"string","format":"binary","description":"operation=importData: the form data to fill in, as FDF, XFDF or JSON ({ \"fieldName\": value } or { \"fields\": {...} }).","x-davix-h2i-depends-on":[{"field":"operation","equals":"importData"}],"x-davix-h2i-file":{"note":"Up to 10 MB, 5000 fields."}},"operation":{"type":"string","enum":["flatten","fill","fillAndFlatten","listFields","createField","editField","exportData","importData"],"default":"flatten","description":"What to do with the form.","x-davix-h2i-enum":"PdfsFormsOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/forms.js"}},"format":{"type":"string","enum":["json","fdf","xfdf"],"description":"exportData: fdf, xfdf or json (default). importData: the format of the data file (default: recognised from its content).","x-davix-h2i-enum":"PdfsFormsFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-data.js"}},"fields":{"type":"object","properties":{},"additionalProperties":true,"description":"For fill/fillAndFlatten: a non-empty JSON object mapping fieldName -> value.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid JSON -> 400 invalid_parameter; empty/missing -> 400 missing_field; unknown field names -> 400.","evidence":"src/processing/pdfs/engine.js:flattenForms"},"x-davix-h2i-required-when":[{"field":"operation","in":["fill","fillAndFlatten"]}]},"editFields":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","properties":{"name":{"type":"string","description":"Existing field name."},"x":{"type":"number","description":"New left."},"y":{"type":"number","description":"New bottom."},"width":{"type":"number","exclusiveMinimum":0,"description":"New width."},"height":{"type":"number","exclusiveMinimum":0,"description":"New height."},"fontSize":{"type":"number","minimum":1,"maximum":200,"description":"Text fields only."},"backgroundColor":{"type":"string","format":"color","description":"#rrggbb. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"borderColor":{"type":"string","format":"color","description":"#rrggbb. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"alignment":{"type":"string","enum":["left","center","right"],"description":"Text fields only.","x-davix-h2i-enum":"PdfsAlignment"},"readOnly":{"type":"boolean","description":"Make read-only."},"required":{"type":"boolean","description":"Mark required."},"widgetIndex":{"type":"integer","minimum":0,"description":"Which widget of the field (default 0)."}},"required":["name"]},"description":"For editField: changes to apply (max 100); each edit must change at least one property.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:editFormFields"},"x-davix-h2i-required-when":[{"field":"operation","equals":"editField"}]},"newFields":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","properties":{"type":{"type":"string","enum":["text","checkbox","radio","dropdown","optionList"],"description":"Field type.","x-davix-h2i-enum":"PdfsType"},"name":{"type":"string","description":"Unique field name."},"page":{"type":"integer","minimum":1,"description":"1-based page."},"x":{"type":"number","description":"Left (points)."},"y":{"type":"number","description":"Bottom (points)."},"width":{"type":"number","exclusiveMinimum":0,"description":"Width (points)."},"height":{"type":"number","exclusiveMinimum":0,"description":"Height (points)."},"options":{"type":"array","items":{"type":"string"},"description":"Choices (required for radio/dropdown/optionList)."},"defaultValue":{"type":"string","description":"Initial value."}},"required":["type","name","page","x","y","width","height"]},"description":"For createField: fields to create (max 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:createFormFields"},"x-davix-h2i-required-when":[{"field":"operation","equals":"createField"}]},"flattenForms":{"type":"boolean","default":true,"description":"Only for operation=flatten: set false to keep the form editable. fill never flattens; fillAndFlatten always does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only the string \"false\" disables flattening; everything else = true","evidence":"src/api/pdfs/forms.js"}},"generateAppearances":{"type":"boolean","description":"Regenerate field appearances so values render in every viewer.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/api/pdfs/forms.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"fields":{"contentType":"application/json"},"editFields":{"contentType":"application/json"},"newFields":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"hasForm":{"type":"boolean"},"fieldCount":{"type":"integer"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["text","checkbox","radio","dropdown","optionList","unknown"]},"currentValue":{},"options":{"type":"array","items":{"type":"string"},"nullable":true},"isReadOnly":{"type":"boolean","nullable":true}},"required":["name","type"]}},"xfa":{"type":"boolean","description":"true when the form is an XFA form (only its AcroForm fallback is read)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["hasForm","fieldCount","fields"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"fields":{"type":"integer"},"fieldsFilled":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url"]}],"description":"operation=list -> the field listing; fill / flatten / create -> {url}."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-actions":{"selector":"operation","style":"enum-field","items":[{"name":"flatten","description":"Flatten all fields (default).","fields":["flattenForms","generateAppearances"]},{"name":"fill","description":"Fill fields, keep the form interactive.","fields":["fields","generateAppearances"],"requiredFields":["fields"]},{"name":"fillAndFlatten","fields":["fields","generateAppearances"],"requiredFields":["fields"]},{"name":"listFields","description":"Returns the form fields as JSON (no file output).","fields":[]},{"name":"createField","fields":["newFields"],"requiredFields":["newFields"]},{"name":"editField","fields":["editFields"],"requiredFields":["editFields"]},{"name":"exportData","description":"Write the field values as FDF, XFDF or JSON (a file).","fields":["format"]},{"name":"importData","description":"Fill the form from an FDF / XFDF / JSON file (or `fields`), keeping it interactive unless flattenForms=true.","fields":["data","format","fields","flattenForms"]}]},"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.forms","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/forms\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=flatten' \\\n  -F 'format=json' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.forms({\n    \"file\": 'document.pdf',\n    \"operation\": \"flatten\",\n    \"format\": \"json\",\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->forms([\n    'file' => 'document.pdf',\n    'operation' => 'flatten',\n    'format' => 'json',\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/forms-bulk":{"post":{"operationId":"pdfs.forms-bulk","summary":"Bulk fill forms","description":"Fill a fillable PDF form once for every row of a sheet (CSV, TSV, Excel or JSON) and get a ZIP of filled PDFs or one merged PDF. Columns are matched to form fields by name or by a mapping.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The fillable PDF form.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage."}},"data_file":{"type":"string","format":"binary","description":"The sheet: a CSV, TSV, XLSX, ODS or JSON file. The first row holds the column names, one filled form is made for each row.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Up to 500 rows per request."}},"mapping":{"type":"object","example":"{\"Full name\":\"applicant_name\"}","description":"Which column fills which field, as { \"Column\": \"Field name\" }. Columns not listed are matched to the field with the same name (capitals, spaces and underscores are ignored).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): turn the filled fields into plain page content so they can no longer be edited.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"output":{"type":"string","enum":["zip","merged"],"default":"zip","description":"zip (default): one PDF per row in a ZIP. merged: all forms in one PDF.","x-davix-h2i-enum":"PdfsFormsBulkOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"name_column":{"type":"string","example":"id","description":"The column that names the files (default: form-1, form-2 ...).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"prefix":{"type":"string","example":"application-","description":"Text put before every file name (up to 40 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"max":{"type":"integer","minimum":1,"maximum":500,"default":200,"description":"The most forms to make, 1 to 500 (default 200).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"skip_empty":{"type":"boolean","default":true,"description":"true (default): leave out rows that are completely empty.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"ignore_unknown":{"type":"boolean","default":true,"description":"true (default): columns that match no field are ignored (listed in unmappedColumns). false: refuse the request.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"true_values":{"type":"string","example":"yes,true,1","description":"The cell values that tick a checkbox, comma-separated (default: yes, y, true, 1, x, on, checked).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"strict_values":{"type":"boolean","default":false,"description":"true: refuse a value that is not an option of a choice field. false (default): leave that field empty and warn.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/forms-bulk.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","data_file"]},"encoding":{"mapping":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, count, files: [{ name, bytes }], unmappedColumns, unfilledFields, pagesTotal?, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["zip","pdf"]},"count":{"type":"integer","description":"How many forms were filled."},"files":{"type":"array","items":{"type":"object"},"description":"Each form: name and bytes."},"unmappedColumns":{"type":"array","items":{"type":"string"},"description":"Sheet columns that matched no form field."},"unfilledFields":{"type":"array","items":{"type":"string"},"description":"Form fields that no column filled."},"pagesTotal":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","count","files","unmappedColumns","unfilledFields"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"file","minFiles":2,"ceiling":1,"directFiles":1,"multiFile":"native","multipleToggle":false,"fixedFiles":true,"either":false},"x-davix-h2i-id":"pdfs.forms-bulk","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","upload_mb_per_request","max_file_size_bytes","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/forms-bulk\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'data_file=@document.pdf' \\\n  -F 'mapping={\"Full name\":\"applicant_name\"}' \\\n  -F 'output=zip' \\\n  -F 'name_column=id'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.formsBulk({\n    \"file\": 'document.pdf',\n    \"data_file\": 'document.pdf',\n    \"mapping\": \"{\\\"Full name\\\":\\\"applicant_name\\\"}\",\n    \"output\": \"zip\",\n    \"name_column\": \"id\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->formsBulk([\n    'file' => 'document.pdf',\n    'data_file' => 'document.pdf',\n    'mapping' => '{\"Full name\":\"applicant_name\"}',\n    'output' => 'zip',\n    'name_column' => 'id',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/headers-footers":{"post":{"operationId":"pdfs.headers-footers","summary":"Add headers, footers and page numbers","description":"Write text at the top and bottom of pages: a header, a footer and page numbers, each with left / centre / right parts and templates ({n} {total} {date} {title}). Any script works; Latin text stays real PDF text.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"header":{"type":"string","description":"Header: text, or JSON { \"left\": \"...\", \"center\": \"...\", \"right\": \"...\" }. Templates: {n} page number, {total} page count, {date} today (ISO), {title} document title.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"footer":{"type":"string","description":"Footer: same form as header.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"page_numbers":{"type":"string","description":"true (a plain number at the footer centre) or a template such as \"Page {n} of {total}\". Ignored when footer.center is set.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"numbering":{"type":"string","enum":["arabic","roman","ROMAN","alpha","ALPHA"],"default":"arabic","description":"Number style: arabic (default), roman, ROMAN, alpha, ALPHA.","x-davix-h2i-enum":"PdfsNumbering","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"start_at":{"type":"integer","default":1,"description":"The number printed on the first page (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"skip_first":{"type":"boolean","default":false,"description":"Leave the first page unmarked and start numbering on page 2 (a cover page).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"pages":{"type":"string","description":"Pages: \"all\" (default), \"first\", \"last\", \"odd\", \"even\", or numbers and ranges such as \"1,3-5\" (1-based). A page outside the document -> 400.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"margin":{"type":"number","minimum":0,"maximum":300,"default":28,"description":"Distance from the page edge in points (default 28).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"fontFamily":{"type":"string","description":"Font family for scripts the standard fonts cannot draw (GET /v1/formats lists installed fonts); Latin text uses Helvetica.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"fontSize":{"type":"integer","minimum":6,"maximum":400,"default":10,"description":"Font size in points (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"fontWeight":{"type":"string","description":"normal (default), bold or a number 100-900.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"italic":{"type":"boolean","description":"Italic text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"color":{"type":"string","format":"color","default":"#444444","description":"Text colour, e.g. #444444 (default). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"lang":{"type":"string","description":"Language tag for scripts with regional forms (ja, zh-Hans, ko, ar ...).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"direction":{"type":"string","enum":["auto","ltr","rtl"],"description":"auto (default), ltr or rtl.","x-davix-h2i-enum":"Direction","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, pagesMarked, drawnAs: [\"text\" | \"image\"], warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"pagesMarked":{"type":"integer"},"drawnAs":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","pagesMarked","drawnAs"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.headers-footers","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/headers-footers\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'numbering=arabic' \\\n  -F 'margin=28' \\\n  -F 'fontSize=10'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.headersFooters({\n    \"file\": 'document.pdf',\n    \"numbering\": \"arabic\",\n    \"margin\": 28,\n    \"fontSize\": 10\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->headersFooters([\n    'file' => 'document.pdf',\n    'numbering' => 'arabic',\n    'margin' => 28,\n    'fontSize' => 10,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/images":{"post":{"operationId":"pdfs.images","summary":"Extract embedded raster images","description":"Extract embedded raster images","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to extract embedded raster images from.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","pattern":"^(all|first|\\s*\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*\\s*)$","default":"all","description":"Pages: \"all\", \"first\", or a comma list of pages/ranges such as \"1,3-5\" (1-based). Default = all pages.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Lenient parser: out-of-range pages are dropped/clamped to the document; if nothing valid remains the result falls back to page 1 (it does NOT return an error).","evidence":"src/processing/pdfs/engine.js:parsePageNumbers"}},"format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"Output image format.","x-davix-h2i-enum":"RasterFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/pdfs/images.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return multi-file output as ONE zip download instead of an array of signed URLs (billing is unchanged).","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"ignore","normalization":"lower-cased; any value other than \"zip\" is ignored","evidence":"src/api/pdfs/extract.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"pageCount":{"type":"integer"},"imagesExtracted":{"type":"integer"},"imagesSkipped":{"type":"integer"},"skipped":{},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"pageNumber":{"type":"integer"},"imageIndex":{"type":"integer"}},"required":["url","format","sizeBytes","pageNumber","imageIndex"]}},"url":{"type":"string","format":"uri","description":"Only when bundled as a zip (results is then absent)."},"format":{"type":"string","enum":["zip"]},"sizeBytes":{"type":"integer"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["pageCount","imagesExtracted","imagesSkipped","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.images","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_extract_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/images\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'format=png' \\\n  -F 'output_bundle=zip' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.images({\n    \"file\": 'document.pdf',\n    \"format\": \"png\",\n    \"output_bundle\": \"zip\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->images([\n    'file' => 'document.pdf',\n    'format' => 'png',\n    'output_bundle' => 'zip',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/ink-coverage":{"post":{"operationId":"pdfs.ink-coverage","summary":"Ink coverage","description":"Measure how much of each page is covered by cyan, magenta, yellow and black ink, tell colour pages from black-and-white ones, flag pages above an ink limit and estimate the print cost.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to measure.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to measure: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/ink-coverage.js"}},"color_threshold":{"type":"number","minimum":0,"maximum":100,"default":0.1,"description":"A page with cyan, magenta or yellow above this percent is a colour page (default 0.1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/ink-coverage.js"}},"limit":{"type":"number","minimum":0,"maximum":400,"description":"A total ink limit in percent of the page area (cyan + magenta + yellow + black, up to 400); pages above it are listed.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/ink-coverage.js"}},"price_color":{"type":"number","minimum":0,"maximum":1000,"description":"The price of one colour page, for the cost estimate.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/ink-coverage.js"}},"price_black_white":{"type":"number","minimum":0,"maximum":1000,"description":"The price of one black-and-white page, for the cost estimate.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/ink-coverage.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ pages: [{ page, cyan, magenta, yellow, black, total, color, overLimit? }], summary }","content":{"application/json":{"schema":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object"},"description":"For every page: the coverage of each ink in percent of the page area, the total, and color (true for a colour page)."},"summary":{"type":"object","description":"pages, colorPages, blackWhitePages, average per ink, maxTotal, and estimatedCost (with a price) and overLimit (with limit)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["pages","summary"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.ink-coverage","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/ink-coverage\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=1-3' \\\n  -F 'color_threshold=0.1' \\\n  -F 'limit=0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.inkCoverage({\n    \"file\": 'document.pdf',\n    \"pages\": \"1-3\",\n    \"color_threshold\": 0.1,\n    \"limit\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->inkCoverage([\n    'file' => 'document.pdf',\n    'pages' => '1-3',\n    'color_threshold' => 0.1,\n    'limit' => 0,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/inspect":{"post":{"operationId":"pdfs.inspect","summary":"Structure/fonts/signatures/security analysis","description":"Structure/fonts/signatures/security analysis","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"checks":{"type":"array","default":["structure"],"items":{"type":"string","enum":["structure","fonts","signatures","security","pdfa","pdfua","accessibility","properties"],"x-davix-h2i-enum":"PdfsChecksItem"},"description":"Checks to run: a comma-separated string or a JSON array (default: structure). pdfa / pdfua = conformance validation by veraPDF; accessibility = tagging, language and title; properties = version, boxes, forms (XFA), layers, attachments, JavaScript, labels, bookmarks and the standards the file claims.","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Empty or unknown check -> 400.","evidence":"src/processing/pdfs/engine.js:inspectPdf"}},"pdfaFlavour":{"type":"string","enum":["auto","1a","1b","2a","2b","2u","3a","3b","3u"],"default":"auto","description":"PDF/A flavour validated by the pdfa check.","x-davix-h2i-enum":"PdfsInspectPdfaFlavour","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/pdfs/pdfa-engine.js:validatePdfa"},"x-davix-h2i-depends-on":[{"field":"checks","in":["pdfa"]}]},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"checks":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"structure":{"type":"object"},"fonts":{"type":"object"},"signatures":{"type":"object"},"security":{"type":"object"},"pdfa":{"type":"object"},"pdfua":{"type":"object"},"accessibility":{"type":"object"},"properties":{"type":"object"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"additionalProperties":true,"description":"One key per requested check; each sub-structure depends on the check."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.inspect","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/inspect\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'checks=[\"structure\"]' \\\n  -F 'pdfaFlavour=auto' \\\n  -F 'validate_only=false'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.inspect({\n    \"file\": 'document.pdf',\n    \"checks\": [\n      \"structure\"\n    ],\n    \"pdfaFlavour\": \"auto\",\n    \"validate_only\": false\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->inspect([\n    'file' => 'document.pdf',\n    'checks' => ['structure'],\n    'pdfaFlavour' => 'auto',\n    'validate_only' => false,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/interleave":{"post":{"operationId":"pdfs.interleave","summary":"Interleave scans","description":"Weave two PDFs into one: the front sides and the back sides of a double-sided stack scanned by a one-sided feeder (front 1, back 1, front 2, back 2 ...), with the backs reversed when they were scanned from the last sheet to the first.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The first PDF (normally the front sides).","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage."}},"other":{"type":"string","format":"binary","description":"The second PDF (normally the back sides).","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"]}},"reverse_second":{"type":"boolean","default":false,"description":"true: take the pages of the second PDF from the last to the first (backs scanned in reverse order). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/interleave.js"}},"reverse_first":{"type":"boolean","default":false,"description":"true: take the pages of the first PDF from the last to the first. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/interleave.js"}},"step":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"How many pages are taken from one file before the other comes, 1 to 20 (default 1; 2 gives 1-2 of the first, 1-2 of the second, and so on).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/interleave.js"}},"start_with":{"type":"string","enum":["first","second"],"default":"first","description":"Which file the result starts with: first (default) or second.","x-davix-h2i-enum":"PdfsStartWith","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/interleave.js"}},"leftover":{"type":"string","enum":["keep","drop","error"],"default":"keep","description":"When one file has more pages: keep (default) puts the rest at the end, drop stops when the shorter file is used up, error refuses the job.","x-davix-h2i-enum":"PdfsLeftover","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/interleave.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","other"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, pagesFirst, pagesSecond, pagesOut, dropped, leftover, order: [{ page, from, sourcePage }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"pagesFirst":{"type":"integer"},"pagesSecond":{"type":"integer"},"pagesOut":{"type":"integer"},"dropped":{"type":"integer","description":"Pages left out (only with leftover=drop)."},"leftover":{"type":"integer","description":"How many pages of the longer file were appended after the shorter one ended."},"order":{"type":"array","items":{"type":"object"},"description":"For every page of the result: its number, which file it came from (first or second) and its page number in that file (the first 500)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","pagesFirst","pagesSecond","pagesOut","dropped","leftover","order"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"file","minFiles":2,"ceiling":1,"directFiles":1,"multiFile":"native","multipleToggle":false,"fixedFiles":true,"either":false},"x-davix-h2i-id":"pdfs.interleave","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/interleave\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'other=@document.pdf' \\\n  -F 'step=1' \\\n  -F 'start_with=first' \\\n  -F 'leftover=keep'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.interleave({\n    \"file\": 'document.pdf',\n    \"other\": 'document.pdf',\n    \"step\": 1,\n    \"start_with\": \"first\",\n    \"leftover\": \"keep\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->interleave([\n    'file' => 'document.pdf',\n    'other' => 'document.pdf',\n    'step' => 1,\n    'start_with' => 'first',\n    'leftover' => 'keep',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/layers":{"post":{"operationId":"pdfs.layers","summary":"PDF layers","description":"List the layers (optional content groups) of a PDF with their on/off state, or switch layers on and off by name: a map without its labels, a drawing without its dimensions, a print without its cut line.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF with layers.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["list","set"],"default":"list","description":"list (default) or set (switch layers).","x-davix-h2i-enum":"PdfsLayersOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/layers.js"}},"show":{"type":"array","example":"[\"Labels\"]","items":{"type":"string"},"description":"set: the names of the layers to switch on, as a list or comma-separated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/layers.js"}},"hide":{"type":"array","example":"[\"Cut line\"]","items":{"type":"string"},"description":"set: the names of the layers to switch off.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/layers.js"}},"show_all":{"type":"boolean","default":false,"description":"set: switch every layer on first (then hide applies). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/layers.js"}},"hide_all":{"type":"boolean","default":false,"description":"set: switch every layer off first (then show applies). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/layers.js"}},"case_sensitive":{"type":"boolean","default":false,"description":"true: layer names must match in upper and lower case. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/layers.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"show":{"contentType":"application/json"},"hide":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"list: { operation, layers: [{ index, name, visible }], count, hidden }. set: { url, sizeBytes, operation, layers, changed, changedCount }.","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","enum":["list","set"]},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"layers":{"type":"array","items":{"type":"object"},"description":"The layers: index, name, visible."},"count":{"type":"integer"},"hidden":{"type":"integer"},"changed":{"type":"array","items":{"type":"object"},"description":"set: the layers whose state changed."},"changedCount":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["operation","layers"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.layers","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/layers\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=list' \\\n  -F 'show=[\"Labels\"]' \\\n  -F 'hide=[\"Cut line\"]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.layers({\n    \"file\": 'document.pdf',\n    \"operation\": \"list\",\n    \"show\": \"[\\\"Labels\\\"]\",\n    \"hide\": \"[\\\"Cut line\\\"]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->layers([\n    'file' => 'document.pdf',\n    'operation' => 'list',\n    'show' => '[\"Labels\"]',\n    'hide' => '[\"Cut line\"]',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/layout":{"post":{"operationId":"pdfs.layout","summary":"Crop, resize or impose a PDF as a booklet","description":"crop: cut margins or a box from pages (non-destructive CropBox, or permanent); resize: fit pages onto a paper size; booklet: arrange pages two per sheet side so the printed, folded stack reads in order.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["crop","resize","booklet"],"description":"crop, resize or booklet.","x-davix-h2i-enum":"PdfsLayoutOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"pages":{"type":"string","description":"Pages: \"all\" (default), \"first\", \"last\", \"odd\", \"even\", or numbers and ranges such as \"1,3-5\" (1-based). A page outside the document -> 400. (crop and resize).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"margin":{"type":"number","description":"crop: the same margin on all four sides, in points or \"10%\". booklet: space around each page in points.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"margins":{"type":"object","properties":{"top":{"type":"string"},"right":{"type":"string"},"bottom":{"type":"string"},"left":{"type":"string"}},"description":"crop: { top, right, bottom, left } in points or \"10%\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"box":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"}},"required":["x","y","width","height"],"description":"crop: { x, y, width, height } in points from the bottom-left of the page.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"permanent":{"type":"boolean","default":false,"description":"crop: also shrink the MediaBox so nothing outside shows in any viewer or printer. The hidden content stays in the file: use /v1/pdfs/redact for secrets.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"size":{"type":"string","description":"resize: A0-A6, B4, B5, Letter, Legal, Tabloid, Ledger, Executive, or JSON { width, height } in points.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown size -> 400 with the allowed names.","evidence":"src/api/pdfs/pdf-tools.js"}},"fit":{"type":"string","enum":["contain","cover","stretch","none"],"default":"contain","description":"resize: contain (default, keep the shape, fit inside), cover (fill, may crop), stretch, none (centre unscaled).","x-davix-h2i-enum":"PdfsFit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"orientation":{"type":"string","enum":["auto","portrait","landscape","keep"],"default":"auto","description":"resize: auto / keep (follow each page, default), portrait or landscape.","x-davix-h2i-enum":"PdfsOrientation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"background":{"type":"string","format":"color","description":"resize: page colour behind the content, e.g. #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"sheet":{"type":"string","description":"booklet: the sheet size (default A4); sheets are landscape with two pages side by side.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"binding":{"type":"string","enum":["left","right"],"default":"left","description":"booklet: left (default) or right (right-to-left books).","x-davix-h2i-enum":"PdfsBinding","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","operation"]},"encoding":{"margins":{"contentType":"application/json"},"box":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, operation, pagesCropped? | pagesResized?, warnings? | sourcePages, blankPagesAdded, sheets, outputPages }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"operation":{"type":"string","enum":["crop","resize","booklet"]},"pagesCropped":{"type":"integer"},"pagesResized":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"sourcePages":{"type":"integer"},"blankPagesAdded":{"type":"integer"},"sheets":{"type":"integer"},"outputPages":{"type":"integer"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","operation"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.layout","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/layout\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=crop' \\\n  -F 'fit=contain' \\\n  -F 'orientation=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.layout({\n    \"file\": 'document.pdf',\n    \"operation\": \"crop\",\n    \"fit\": \"contain\",\n    \"orientation\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->layout([\n    'file' => 'document.pdf',\n    'operation' => 'crop',\n    'fit' => 'contain',\n    'orientation' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/links":{"post":{"operationId":"pdfs.links","summary":"Links in a PDF","description":"List the links of a PDF (web, e-mail and jumps inside the document), check that the web addresses answer, remove links, or make the web and e-mail addresses written in the text clickable.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to work on.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["list","check","remove","auto-link"],"default":"list","description":"list (default), check (also ask every web address), remove, or auto-link (make written addresses clickable).","x-davix-h2i-enum":"PdfsLinksOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/links.js"}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to work on: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/links.js"}},"kind":{"type":"string","enum":["all","external","internal","email"],"default":"all","description":"list, check and remove: which links: all (default), external (web addresses), internal (jumps in the document) or email.","x-davix-h2i-enum":"PdfsKind","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/links.js"}},"pattern":{"type":"string","example":"https://example.com/*","description":"Only links whose address matches this text, with * (any text) and ? (one character), not case-sensitive.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/links.js"}},"email":{"type":"boolean","default":true,"description":"auto-link: also make e-mail addresses clickable (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/links.js"}},"www":{"type":"boolean","default":true,"description":"auto-link: also make addresses that start with www. clickable (default true).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/links.js"}},"max_checks":{"type":"integer","minimum":1,"maximum":50,"default":20,"description":"check: the most addresses to ask, 1 to 50 (default 20).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/links.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"list / check: { operation, total, counts, links: [{ page, kind, url?, address?, toPage?, rect, check? }], checked?, skipped?, broken? }. remove / auto-link: { url, sizeBytes, operation, removed? / added?, changed, links }.","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","enum":["list","check","remove","auto-link"]},"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"total":{"type":"integer"},"counts":{"type":"object","description":"How many links of each kind: external, internal, email."},"links":{"type":"array","items":{"type":"object"},"description":"The links: page, kind, url (or address, toPage), rect and, with check, check: { ok, status, error?, finalUrl? }."},"checked":{"type":"integer"},"skipped":{"type":"integer","description":"check: addresses not asked because of max_checks."},"broken":{"type":"integer","description":"check: addresses that did not answer."},"removed":{"type":"integer"},"added":{"type":"integer"},"changed":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["operation"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.links","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/links\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=list' \\\n  -F 'pages=1-3' \\\n  -F 'kind=all'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.links({\n    \"file\": 'document.pdf',\n    \"operation\": \"list\",\n    \"pages\": \"1-3\",\n    \"kind\": \"all\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->links([\n    'file' => 'document.pdf',\n    'operation' => 'list',\n    'pages' => '1-3',\n    'kind' => 'all',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/manipulate":{"post":{"operationId":"pdfs.manipulate","summary":"Rotate/delete/reorder/resize/annotate/bookmark/link/stamp pages","description":"Rotate/delete/reorder/resize/annotate/bookmark/link/stamp pages","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to modify.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"stampImages":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":10,"description":"Images referenced by insertImage / annotate(type=stamp) through their 0-based imageIndex (upload order).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"At most 10 images (MAX_MANIPULATE_STAMP_IMAGES)."}},"operations":{"type":"array","minItems":1,"items":{"type":"object","properties":{"op":{"type":"string","enum":["rotate","deletePages","reorder","setPageSize","setCropBox","insertBlankPage","insertImage","drawShape","addLink","addBookmark","annotate","setViewerPreferences","nUp","splitPage"],"description":"Operation name.","x-davix-h2i-enum":"PdfsOp","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown op -> 400 (reason unknown_operation, with operationIndex).","evidence":"src/processing/pdfs/engine.js:validateManipulateOperations"}}},"required":["op"],"additionalProperties":true},"description":"Ordered operations (JSON array). Each item is {op, ...params}; see `actions` for the parameters of each op. Operations run in order, so page numbers refer to the document as modified by earlier operations.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Empty/invalid -> 400 with details.operationIndex. The reorder completeness check happens at execution time against the current page count.","evidence":"src/processing/pdfs/engine.js:validateManipulateOperations"}},"flattenAnnotations":{"type":"string","enum":["all","print","screen"],"description":"Flatten annotations into page content after the operations.","x-davix-h2i-enum":"PdfsFlattenAnnotations","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Available only when the service offers this capability: see GET /v1/capabilities.","evidence":"src/processing/pdfs/engine.js:flattenAnnotations"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","operations"]},"encoding":{"operations":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"pageCount":{"type":"integer"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","pageCount"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-actions":{"selector":"operations[].op","style":"operations-list","items":[{"name":"rotate","description":"Rotate pages.","fields":["angle","pages"],"requiredFields":["angle"],"allowedValues":{"angle":[90,180,270]},"evidence":"src/processing/pdfs/engine.js:validateManipulateOperations"},{"name":"deletePages","description":"Delete pages; deleting every page is rejected.","fields":["pages"],"requiredFields":["pages"]},{"name":"reorder","description":"order is a full permutation of the current page numbers; an incomplete/invalid permutation -> 400.","fields":["order"],"requiredFields":["order"]},{"name":"setPageSize","description":"width/height in points, > 0 and <= 14400.","fields":["width","height"],"requiredFields":["width","height"]},{"name":"setCropBox","description":"x/y default 0; width/height > 0.","fields":["x","y","width","height"],"requiredFields":["width","height"]},{"name":"insertBlankPage","description":"width/height (points, 0-14400) must be given together; atPage is 1-based (append when omitted).","fields":["width","height","atPage"]},{"name":"insertImage","description":"opacity in [0,1]; imageIndex is a non-negative integer into stampImages.","fields":["page","x","y","width","height","opacity","imageIndex"],"requiredFields":["page","x","y","width","height","imageIndex"]},{"name":"drawShape","description":"shape=line needs x1,y1,x2,y2; other shapes need x,y,width,height. color/fillColor are #rgb/#rrggbb.","fields":["page","shape","x","y","width","height","x1","y1","x2","y2","color","fillColor"],"requiredFields":["page","shape"],"allowedValues":{"shape":["rectangle","circle","ellipse","line"]}},{"name":"addLink","description":"url must start with http:// or https:// (max 2000 chars).","fields":["page","x","y","width","height","url"],"requiredFields":["page","x","y","width","height","url"]},{"name":"addBookmark","description":"title 1-500 characters.","fields":["title","page"],"requiredFields":["title","page"]},{"name":"annotate","description":"ink needs points (2-2000 {x,y}); arrow needs x1,y1,x2,y2; stamp needs imageIndex; note.contents up to 2000 chars.","fields":["type","page","x","y","width","height","x1","y1","x2","y2","points","contents","imageIndex","color","opacity"],"requiredFields":["type","page"],"allowedValues":{"type":["highlight","underline","strikethrough","note","ink","shape","arrow","stamp"]}},{"name":"setViewerPreferences","fields":["pageLayout","pageMode","hideToolbar","openToPage"],"allowedValues":{"pageLayout":["SinglePage","OneColumn","TwoColumnLeft","TwoColumnRight","TwoPageLeft","TwoPageRight"],"pageMode":["UseNone","UseOutlines","UseThumbs","FullScreen","UseOC"]}},{"name":"nUp","fields":["pagesPerSheet"],"requiredFields":["pagesPerSheet"],"allowedValues":{"pagesPerSheet":[2,4,6,9,16]}},{"name":"splitPage","fields":["direction"],"allowedValues":{"direction":["horizontal","vertical"]}}]},"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.manipulate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_split_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/manipulate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operations=[{\"op\":\"rotate\"}]' \\\n  -F 'flattenAnnotations=all' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.manipulate({\n    \"file\": 'document.pdf',\n    \"operations\": [\n      {\n        \"op\": \"rotate\"\n      }\n    ],\n    \"flattenAnnotations\": \"all\",\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->manipulate([\n    'file' => 'document.pdf',\n    'operations' => [[\n            'op' => 'rotate',\n        ]],\n    'flattenAnnotations' => 'all',\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/merge":{"post":{"operationId":"pdfs.merge","summary":"Merge 2+ PDFs into one","description":"Merge 2+ PDFs into one","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"minItems":2,"description":"Two or more PDF files, merged in upload order (or name order with sortByName).","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"At least 2 files (400 missing_field otherwise). The maximum number of files is a plan/settings limit (runtime)."}},"sortByName":{"type":"boolean","description":"Sort the files by filename before merging.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/api/pdfs/merge.js"}},"mode":{"type":"string","enum":["concatenate","collate"],"default":"concatenate","description":"concatenate = file after file; collate = interleave pages across files.","x-davix-h2i-enum":"PdfsMergeMode","x-davix-h2i-behavior":{"onInvalid":"fallback","note":"Any value other than \"collate\" is treated as \"concatenate\".","evidence":"src/api/pdfs/merge.js"}},"collateSize":{"type":"integer","minimum":1,"maximum":100,"default":1,"description":"Pages taken from each file per round (mode=collate).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1,100] or non-integer -> 400.","evidence":"src/processing/pdfs/engine.js:mergePdfsCollated"},"x-davix-h2i-depends-on":[{"field":"mode","equals":"collate"}]},"blankSeparator":{"type":"boolean","description":"Insert a blank page between merged files.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","note":"Not supported with mode=collate (400 invalid_parameter).","evidence":"src/api/pdfs/merge.js"},"x-davix-h2i-conflicts-with":["mode=collate"]},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["files"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"pageCount":{"type":"integer"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","pageCount"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"files","minFiles":2,"ceiling":null,"directFiles":null,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"pdfs.merge","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/merge\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'files=@document.pdf' \\\n  -F 'mode=concatenate' \\\n  -F 'collateSize=1' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.merge({\n    \"files\": 'document.pdf',\n    \"mode\": \"concatenate\",\n    \"collateSize\": 1,\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->merge([\n    'files' => 'document.pdf',\n    'mode' => 'concatenate',\n    'collateSize' => 1,\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/metadata":{"post":{"operationId":"pdfs.metadata","summary":"Read, edit or remove PDF metadata (document information, XMP ...)","description":"Read, edit or remove PDF metadata (document information, XMP ...)","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"mode":{"type":"string","enum":["read","merge","replace","strip","keep"],"description":"read (default when nothing else is asked): list every tag. merge (default when something is asked): apply remove / remove_groups / set / clean and keep the rest. replace: remove everything, then write the tags in `set`. keep: return the file as it is, as a new result (so a request with several files returns every one of them). strip: remove everything (the file keeps looking and opening exactly as before).","x-davix-h2i-enum":"Mode","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown mode -> 400 invalid_parameter. read cannot be combined with changes; strip cannot be combined with remove, remove_groups, set or a partial clean.","evidence":"src/processing/metadata/request.js"}},"clean":{"type":"string","enum":["all","location","personal"],"description":"A ready-made removal: all (= mode=strip), location (GPS position and place names) or personal (location, author and owner names, serial numbers, software, company, document ids).","x-davix-h2i-enum":"Clean","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An invalid value -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"remove":{"type":"array","items":{"type":"string"},"description":"Tags to remove: a JSON array or a comma-separated list of names as listed by a read, e.g. [\"EXIF:Artist\", \"GPS:GPSLatitude\"] (a name without a group matches in every group; * works as a wildcard).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 200 entries or a malformed name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"remove_groups":{"type":"array","items":{"type":"string"},"description":"Whole groups of tags to remove, e.g. [\"GPS\", \"XMP\", \"IPTC\"] (documents: Core, Extended, Custom, Thumbnail, Revisions).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than 200 entries or a malformed group name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"set":{"type":"object","description":"Tags to write, as { \"Group:Tag\": \"value\" } (e.g. {\"EXIF:Artist\": \"Jane\"}; documents: {\"Title\": \"Report\", \"Custom:Project\": \"X-9\"}). A tag the format cannot hold is reported in `report.warnings`.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A non-object, nested values, more than 200 entries, a value over 4000 characters or a malformed name -> 400 invalid_parameter.","evidence":"src/processing/metadata/request.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"writable":{"type":"boolean","description":"Whether this format can be changed (false = read only)."},"tags":{"type":"array","items":{"$ref":"#/components/schemas/MetadataTag"},"description":"Every tag of the file."},"total":{"type":"integer"},"editableCount":{"type":"integer"},"groups":{"type":"array","items":{"type":"object"},"description":"Tag groups with their counts: { name, count }."},"risks":{"type":"object","additionalProperties":true,"description":"What the tags can reveal: location, personal, device, identifier, thumbnail, dates."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}}},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"report":{"$ref":"#/components/schemas/MetadataReport"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url"]}],"description":"Read (nothing asked) -> the metadata object and every tag; change -> {url} of the new PDF and a report when tags were removed or set."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.metadata","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/metadata\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'mode=read' \\\n  -F 'clean=all' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.metadata({\n    \"file\": 'document.pdf',\n    \"mode\": \"read\",\n    \"clean\": \"all\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->metadata([\n    'file' => 'document.pdf',\n    'mode' => 'read',\n    'clean' => 'all',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/ocr":{"post":{"operationId":"pdfs.ocr","summary":"OCR scanned PDFs to text and/or a searchable PDF","description":"OCR scanned PDFs to text and/or a searchable PDF","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The (scanned) PDF.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"languages":{"type":"string","pattern":"^[A-Za-z_]{2,12}(\\+[A-Za-z_]{2,12}){0,3}$","default":"eng","description":"1-4 OCR language codes joined by \"+\" (GET /v1/formats lists the installed packs, which include every OCR language). A plan can limit the number of languages and whether non-core languages are allowed.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Bad syntax or not-installed pack -> 400 (details.allowed).","evidence":"src/processing/images/ocr-engine.js:resolveLanguages"}},"deskew":{"type":"boolean","description":"Straighten pages before OCR.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/api/pdfs/ocr.js"}},"denoise":{"type":"boolean","description":"Denoise pages before OCR.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/api/pdfs/ocr.js"}},"clean":{"type":"boolean","description":"Cleanup preprocessing.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/api/pdfs/ocr.js"}},"output":{"type":"string","enum":["text","pdf","pdfa","docx","json","tsv","hocr","alto"],"default":"text","description":"text = recognised text; pdf = searchable PDF; pdfa = searchable PDF/A; docx = Word document; json = every word with confidence and box; tsv / hocr / alto = the engine layout formats as one file.","x-davix-h2i-enum":"PdfsOcrOutput","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased; docx -> text then converted; pdfa -> pdf then converted","evidence":"src/api/pdfs/ocr.js"}},"mode":{"type":"string","enum":["auto","table"],"default":"auto","description":"auto (default) or table: tune recognition for tables (single block, spaces kept).","x-davix-h2i-enum":"PdfsOcrMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/ocr.js"}},"tables":{"type":"boolean","default":false,"description":"Also detect the tables in the recognised text and return them as `tables`.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/ocr.js"}},"force":{"type":"boolean","description":"OCR every page even when it already has a text layer.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/processing/images/ocr-engine.js:ocrPdf"}},"pages":{"type":"string","pattern":"^(all|first|\\s*\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*\\s*)$","default":"all","description":"Pages: \"all\", \"first\", or a comma list of pages/ranges such as \"1,3-5\" (1-based). Default = all pages.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Lenient parser: out-of-range pages are dropped/clamped to the document; if nothing valid remains the result falls back to page 1 (it does NOT return an error).","evidence":"src/processing/pdfs/engine.js:parsePageNumbers"}},"dpi":{"type":"integer","minimum":150,"maximum":400,"default":300,"description":"Rasterization resolution for OCR.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [150,400] -> 400.","evidence":"src/processing/images/ocr-engine.js:ocrPdf"}},"psm":{"type":"integer","minimum":0,"maximum":13,"default":3,"description":"OCR page segmentation mode (1 and 3-13). 0 and 2 only detect the page orientation and read no text, so they are refused.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [0,13], and 0 or 2, -> 400 invalid_parameter.","evidence":"src/processing/images/ocr-engine.js:ocrImageBuffer"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"pageCount":{"type":"integer"},"pagesProcessed":{"type":"integer"},"pagesOcred":{"type":"integer"},"languages":{},"pages":{"type":"array","items":{"type":"object"}},"fullText":{"type":"string"},"url":{"type":"string","format":"uri","description":"Searchable PDF, DOCX or PDF/A depending on output."},"editableFormat":{"type":"string","enum":["docx"]},"pdfa":{"type":"object","properties":{"level":{"type":"string"},"validated":{"type":"boolean"},"validator":{"type":"string","nullable":true},"profile":{"type":"string","nullable":true}},"required":["level","validated"]},"warnings":{"type":"array","items":{"type":"string"}},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"format":{"type":"string","description":"The file format of `url` for tsv / hocr / alto output."},"tables":{"type":"array","items":{"type":"object"},"description":"Only with tables=true: the tables found in the recognised text (same shape as /v1/pdfs/tables)."},"tableNotes":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["pageCount","pagesProcessed","pagesOcred","languages","pages","fullText"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.ocr","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","ocr_max_pages","ocr_max_languages","allow_ocr_extended_languages","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/ocr\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'output=text' \\\n  -F 'mode=auto' \\\n  -F 'dpi=300'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.ocr({\n    \"file\": 'document.pdf',\n    \"output\": \"text\",\n    \"mode\": \"auto\",\n    \"dpi\": 300\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->ocr([\n    'file' => 'document.pdf',\n    'output' => 'text',\n    'mode' => 'auto',\n    'dpi' => 300,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/optimize":{"post":{"operationId":"pdfs.optimize","summary":"Reduce PDF size / repair structure","description":"Reduce PDF size / repair structure","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to optimize/repair.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"recompressImages":{"type":"boolean","description":"Recompress embedded images (engine=sharp only).","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/api/pdfs/optimize.js"},"x-davix-h2i-depends-on":[{"field":"engine","in":["sharp"]}]},"imageQuality":{"type":"integer","minimum":1,"maximum":100,"default":75,"description":"Quality for recompressed images.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1,100] or non-integer -> 400.","evidence":"src/processing/pdfs/engine.js:recompressPdfImages"}},"imageColorSpace":{"type":"string","enum":["srgb","grayscale"],"description":"Convert recompressed images to this color space.","x-davix-h2i-enum":"PdfsImageColorSpace","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:recompressPdfImages"}},"repair":{"type":"boolean","description":"Try to repair structural damage.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/api/pdfs/optimize.js"}},"profile":{"type":"string","enum":["screen","ebook","printer","prepress"],"description":"engine=gs: screen (72 dpi), ebook (150), printer (300) or prepress (300). Sets the default downsampling resolution.","x-davix-h2i-enum":"PdfsOptimizeProfile","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/optimize-gs.js"}},"downsample_dpi":{"type":"integer","minimum":36,"maximum":600,"description":"engine=gs: downsample images above this resolution (36-600). Overrides the profile.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/optimize-gs.js"}},"grayscale":{"type":"boolean","default":false,"description":"engine=gs: convert colours to grayscale.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/optimize-gs.js"}},"target_size_kb":{"type":"number","minimum":1,"description":"engine=gs: lower the image resolution step by step until the file is at most this size; the answer says whether it was reached (text and vector content are never degraded).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/optimize-gs.js"}},"linearize":{"type":"boolean","default":false,"description":"Make the result a \"fast web view\" PDF (linearized) after any engine.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/optimize-gs.js"}},"engine":{"type":"string","enum":["sharp","qpdf","gs"],"default":"sharp","description":"sharp = recompress images; qpdf = structural optimization; gs = full rewrite (profiles, downsampling, grayscale, a target size). recompressImages requires engine=sharp.","x-davix-h2i-enum":"PdfsEngine","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/pdfs/optimize.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"originalSizeBytes":{"type":"integer"},"newSizeBytes":{"type":"integer"},"compressionRatio":{"type":"number","nullable":true},"method":{"type":"string","enum":["ghostscript","qpdf_optimize_images","image_recompression","structural_repair","structural_rewrite_only"]},"repair":{"type":"object"},"imageRecompression":{"type":"object"},"qpdfOptimizeImages":{"type":"object"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"ghostscript":{"type":"object","properties":{"dpi":{"type":"integer"},"bytesBefore":{"type":"integer"},"bytesAfter":{"type":"integer"}},"description":"engine=gs: what ran. profile, dpi, grayscale, bytesBefore, bytesAfter, attempts [{ dpi, bytes }], and with target_size_kb: targetSizeKb, targetReached."},"linearized":{"type":"boolean","description":"true when linearize was requested and applied."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","originalSizeBytes","newSizeBytes","method"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.optimize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/optimize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'imageQuality=75' \\\n  -F 'imageColorSpace=srgb' \\\n  -F 'profile=screen'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.optimize({\n    \"file\": 'document.pdf',\n    \"imageQuality\": 75,\n    \"imageColorSpace\": \"srgb\",\n    \"profile\": \"screen\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->optimize([\n    'file' => 'document.pdf',\n    'imageQuality' => 75,\n    'imageColorSpace' => 'srgb',\n    'profile' => 'screen',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/outline-text":{"post":{"operationId":"pdfs.outline-text","summary":"Text to outlines","description":"Turn all the text of a PDF into vector outlines so it prints the same everywhere without any font. The text can no longer be selected or searched; the answer reports the fonts before and after.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to convert.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"compatibility":{"type":"string","enum":["1.4","1.5","1.6","1.7"],"default":"1.7","description":"The PDF version of the result: 1.4, 1.5, 1.6 or 1.7 (default).","x-davix-h2i-enum":"PdfsCompatibility","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/outline-text.js"}},"quality":{"type":"string","enum":["keep","screen","ebook","printer","prepress"],"default":"keep","description":"keep (default: pictures are not touched) or a preset that also recompresses pictures: screen, ebook, printer, prepress.","x-davix-h2i-enum":"PdfsQuality","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/outline-text.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, originalBytes, fontsBefore, fontsAfter, compatibility }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"originalBytes":{"type":"integer"},"fontsBefore":{"type":"integer"},"fontsAfter":{"type":"integer","description":"Fonts still in the file (0 when all text became outlines)."},"compatibility":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","originalBytes","fontsBefore","fontsAfter","compatibility"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.outline-text","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/outline-text\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'compatibility=1.7' \\\n  -F 'quality=keep' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.outlineText({\n    \"file\": 'document.pdf',\n    \"compatibility\": \"1.7\",\n    \"quality\": \"keep\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->outlineText([\n    'file' => 'document.pdf',\n    'compatibility' => '1.7',\n    'quality' => 'keep',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/place-signature":{"post":{"operationId":"pdfs.place-signature","summary":"Place signature on a PDF","description":"Put a picture of a signature on the pages you choose of a PDF: in a corner, at exact coordinates or next to a text such as \"Signature:\", with opacity, rotation, and an optional date and name under it. This draws a picture; it is not a digital signature.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The PDF to sign.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage."}},"signature":{"type":"string","format":"binary","description":"The signature picture: PNG (ideally with a transparent background, see the signature tool), JPEG or WebP.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png"],"extensions":["jpg","jpeg","jpe","jfif","png"]}},"pages":{"type":"string","default":"last","description":"Where to sign: last (default), first, all, or numbers and ranges such as 2,4-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"position":{"type":"string","enum":["bottom-right","bottom-left","bottom-center","top-right","top-left","top-center","center"],"default":"bottom-right","description":"The corner: bottom-right (default), bottom-left, bottom-center, top-right, top-left, top-center or center.","x-davix-h2i-enum":"PdfsPlaceSignaturePosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"x":{"type":"number","description":"The left edge of the signature, from the left of the page, instead of position (goes with y).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"y":{"type":"number","description":"The top edge of the signature, from the top of the page, instead of position (goes with x).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"unit":{"type":"string","enum":["pt","percent"],"default":"pt","description":"pt (default: points, 72 to an inch) or percent: the unit of x, y, width and margin.","x-davix-h2i-enum":"PdfsUnit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"width":{"type":"number","description":"The width of the signature (default 150 pt, or 22 percent with unit=percent). The height follows the picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"margin":{"type":"number","description":"The distance from the page edge for a corner (default 36 pt, or 5 percent).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"opacity":{"type":"number","minimum":0.05,"maximum":1,"default":1,"description":"How solid the signature is, 0.05 to 1 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"rotation":{"type":"number","minimum":-180,"maximum":180,"default":0,"description":"Turn the signature, in degrees, -180 to 180 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"anchor_text":{"type":"string","example":"Signature:","description":"Place the signature next to the first place this text is found on each chosen page, for example \"Signature:\" (needs a text layer).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"anchor_position":{"type":"string","enum":["right","left","below","above","over"],"default":"right","description":"Where, relative to the text: right (default), left, below, above or over.","x-davix-h2i-enum":"PdfsAnchorPosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"anchor_offset_x":{"type":"number","minimum":-500,"maximum":500,"default":8,"description":"Move the signature right (positive) or left, in points, from its place next to the text (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"anchor_offset_y":{"type":"number","minimum":-500,"maximum":500,"default":0,"description":"Move the signature down (positive) or up, in points (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"anchor_occurrence":{"type":"string","enum":["first","last","all"],"default":"first","description":"Which match to use on each page: first (default), last or all.","x-davix-h2i-enum":"PdfsAnchorOccurrence","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"trim":{"type":"boolean","default":true,"description":"true (default): cut the empty border off the signature picture before placing it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"remove_background":{"type":"boolean","default":false,"description":"true: make the light paper of a photographed signature transparent. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"background_level":{"type":"integer","minimum":100,"maximum":254,"default":225,"description":"With remove_background: pixels lighter than this (100 to 254, default 225) become transparent.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"date":{"type":"boolean","default":false,"description":"true: write a date under the signature. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"date_text":{"type":"string","example":"16 November 2026","description":"The text of the date (default: today, as 2026-11-16).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"label":{"type":"string","example":"Ada Lovelace","description":"A line of text under the signature, for example the name (up to 80 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"text_size":{"type":"number","minimum":5,"maximum":36,"default":9,"description":"The size of the date and label text in points (default 9).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"text_color":{"type":"string","format":"color","default":"#333333","description":"The colour of the date and label as a hex colour (default #333333). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/place-signature.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","signature"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, placed, placements: [{ page, x, y, width, height }], warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"placed":{"type":"integer"},"placements":{"type":"array","items":{"type":"object"},"description":"Where the signature went: page and the box { x, y, width, height } in points from the top left."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","placed","placements"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"file","minFiles":2,"ceiling":1,"directFiles":1,"multiFile":"native","multipleToggle":false,"fixedFiles":true,"either":false},"x-davix-h2i-id":"pdfs.place-signature","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","upload_mb_per_request","max_file_size_bytes","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/place-signature\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'signature=@document.pdf' \\\n  -F 'position=bottom-right' \\\n  -F 'unit=pt' \\\n  -F 'opacity=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.placeSignature({\n    \"file\": 'document.pdf',\n    \"signature\": 'document.pdf',\n    \"position\": \"bottom-right\",\n    \"unit\": \"pt\",\n    \"opacity\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->placeSignature([\n    'file' => 'document.pdf',\n    'signature' => 'document.pdf',\n    'position' => 'bottom-right',\n    'unit' => 'pt',\n    'opacity' => 1,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/preflight":{"post":{"operationId":"pdfs.preflight","summary":"Print preflight","description":"Check a PDF before it goes to a printer: fonts embedded, picture resolution, RGB pictures, mixed page sizes, trim and bleed boxes, encryption and transparency, against a web, print or prepress profile.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to check.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"profile":{"type":"string","enum":["web","print","prepress"],"default":"print","description":"web (screen), print (office printing, default) or prepress (offset printing: 300 ppi, CMYK, trim and bleed boxes).","x-davix-h2i-enum":"PdfsPreflightProfile","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to check: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"min_ppi":{"type":"integer","minimum":30,"maximum":1200,"description":"The lowest picture resolution accepted, 30 to 1200 (default by profile: 72, 150, 300).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"bleed":{"type":"number","minimum":0,"maximum":20,"description":"The bleed in millimetres the bleed box must have (prepress default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"check_fonts":{"type":"boolean","default":true,"description":"true (default): every font must be embedded.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"check_images":{"type":"boolean","default":true,"description":"true (default): check the resolution and colour of the pictures.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"check_boxes":{"type":"boolean","default":true,"description":"true (default): check the trim and bleed boxes (required by the prepress profile).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"check_sizes":{"type":"boolean","default":true,"description":"true (default): report pages of different sizes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"flag_transparency":{"type":"boolean","default":true,"description":"true (default): with prepress, warn about pages that use transparency.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"strict":{"type":"boolean","default":false,"description":"true: warnings also fail the check. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/preflight.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ passed, profile, errorCount, warningCount, findings: [{ rule, severity, message, page? }], summary }","content":{"application/json":{"schema":{"type":"object","properties":{"passed":{"type":"boolean"},"profile":{"type":"string","enum":["web","print","prepress"]},"errorCount":{"type":"integer"},"warningCount":{"type":"integer"},"findings":{"type":"array","items":{"type":"object"},"description":"Each finding: rule (for example font-not-embedded, low-resolution), severity (error or warning), message, and page where it applies."},"summary":{"type":"object","description":"pages, fonts, images, lowestPpi, pageSizes, transparentPages and the minPpi used."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["passed","profile","errorCount","warningCount","findings","summary"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.preflight","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/preflight\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'profile=print' \\\n  -F 'pages=1-3' \\\n  -F 'min_ppi=30'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.preflight({\n    \"file\": 'document.pdf',\n    \"profile\": \"print\",\n    \"pages\": \"1-3\",\n    \"min_ppi\": 30\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->preflight([\n    'file' => 'document.pdf',\n    'profile' => 'print',\n    'pages' => '1-3',\n    'min_ppi' => 30,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/print-marks":{"post":{"operationId":"pdfs.print-marks","summary":"Print marks","description":"Add what a print shop asks for: crop marks, registration marks, colour bars and a page-info line in a margin (slug) around every page, with the trim box and bleed box set to the original page size and the bleed.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to add the marks to.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to add marks to: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"marks":{"type":"array","example":"[\"crop\",\"registration\"]","items":{"type":"string"},"description":"Which marks: crop (default), registration, color-bars, page-info; a list or comma-separated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"bleed":{"type":"number","minimum":0,"maximum":20,"default":3,"description":"The bleed in millimetres, 0 to 20 (default 3). It sets the bleed box and where the marks start; the artwork must already reach that far.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"offset":{"type":"number","minimum":0,"maximum":20,"default":2,"description":"The gap between the bleed and the marks in millimetres, 0 to 20 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"length":{"type":"number","minimum":2,"maximum":20,"default":5,"description":"The length of a crop mark in millimetres, 2 to 20 (default 5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"weight":{"type":"number","minimum":0.1,"maximum":3,"default":0.25,"description":"The line weight of the marks in points, 0.1 to 3 (default 0.25).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"slug":{"type":"number","minimum":0,"maximum":60,"description":"The extra margin around the page in millimetres, up to 60 (default: just enough for the chosen marks).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"color":{"type":"string","enum":["registration","black"],"default":"registration","description":"registration (default: all four inks, as printers expect) or black.","x-davix-h2i-enum":"PdfsColor","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"info":{"type":"string","example":"Job 4711","description":"With page-info: text put before \"Page n of m\", for example a job number (up to 120 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/print-marks.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"marks":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, marks, slugMm, bleedMm, pages: [{ page, trim: { width, height }, size: { width, height } }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"marks":{"type":"array","items":{"type":"string"},"description":"The marks that were drawn."},"slugMm":{"type":"number","description":"The margin added on every side, in mm."},"bleedMm":{"type":"number"},"pages":{"type":"array","items":{"type":"object"},"description":"For every page changed: page, trim size and new size in mm."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","marks","slugMm","bleedMm","pages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.print-marks","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/print-marks\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=1-3' \\\n  -F 'marks=[\"crop\",\"registration\"]' \\\n  -F 'bleed=3'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.printMarks({\n    \"file\": 'document.pdf',\n    \"pages\": \"1-3\",\n    \"marks\": \"[\\\"crop\\\",\\\"registration\\\"]\",\n    \"bleed\": 3\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->printMarks([\n    'file' => 'document.pdf',\n    'pages' => '1-3',\n    'marks' => '[\"crop\",\"registration\"]',\n    'bleed' => 3,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/redact":{"post":{"operationId":"pdfs.redact","summary":"Secure burn-in redaction: affected pages are rasterized with opaque black boxes and rebuilt in a new PDF -- no text/objects survive underneath","description":"Secure burn-in redaction: affected pages are rasterized with opaque black boxes and rebuilt in a new PDF -- no text/objects survive underneath","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to redact.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"permanent":{"type":"boolean","description":"Must be true: acknowledges that redaction is irreversible (affected pages are rasterized).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Anything other than \"true\" -> 400 invalid_parameter.","evidence":"src/api/pdfs/redact.js"}},"targets":{"type":"array","maxItems":500,"items":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"description":"1-based page."},"x":{"type":"number","description":"Left (points)."},"y":{"type":"number","description":"Bottom (points)."},"width":{"type":"number","exclusiveMinimum":0,"description":"Width (points)."},"height":{"type":"number","exclusiveMinimum":0,"description":"Height (points)."}},"required":["page","x","y","width","height"]},"description":"Explicit redaction boxes (JSON array, max 500).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:normalizeRedactionRequest"}},"searchText":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":200},"description":"Phrases to find and redact (JSON array, up to 100 strings of at most 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:normalizeRedactionRequest"}},"patterns":{"type":"array","items":{"type":"string","enum":["email","ssn","creditCard"],"x-davix-h2i-enum":"PdfsPatternsItem"},"description":"Built-in patterns to redact (JSON array).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:normalizeRedactionRequest"}},"caseSensitive":{"type":"boolean","description":"Case-sensitive searchText matching.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/processing/pdfs/engine.js:redactPdf"}},"applyRedactAnnotations":{"type":"boolean","description":"Also redact the areas of existing /Redact annotations (not supported on rotated pages).","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/processing/pdfs/engine.js:redactPdf"}},"dpi":{"type":"integer","minimum":72,"maximum":300,"default":150,"description":"Rasterization resolution of redacted pages.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [72,300] -> 400; a page larger than 60,000,000 pixels at this dpi -> 400.","evidence":"src/processing/pdfs/engine.js:redactPdf"}},"padding":{"type":"number","minimum":0,"maximum":20,"default":0,"description":"Extra padding around each box (points).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [0,20] -> 400.","evidence":"src/processing/pdfs/engine.js:redactPdf"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","permanent"]},"encoding":{"targets":{"contentType":"application/json"},"searchText":{"contentType":"application/json"},"patterns":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{url, pageCount, pagesRedacted, redactionsApplied, dpi, secure:true}. If no target matches the request FAILS (400) rather than returning an unredacted document. Input metadata/attachments/JS/outlines are not carried into the output.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"pageCount":{"type":"integer"},"pagesRedacted":{"type":"integer"},"redactionsApplied":{"type":"integer"},"dpi":{"type":"integer"},"secure":{"type":"boolean"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","pageCount","pagesRedacted","redactionsApplied","dpi","secure"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.redact","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/redact\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'permanent=true' \\\n  -F 'dpi=150' \\\n  -F 'padding=0'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.redact({\n    \"file\": 'document.pdf',\n    \"permanent\": true,\n    \"dpi\": 150,\n    \"padding\": 0\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->redact([\n    'file' => 'document.pdf',\n    'permanent' => true,\n    'dpi' => 150,\n    'padding' => 0,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/remove-blank":{"post":{"operationId":"pdfs.remove-blank","summary":"Remove blank pages","description":"Find the blank pages of a PDF (typical of double-sided scans) by how much ink they carry inside the margins, and take them out; or only report them.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to clean.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to check: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"threshold":{"type":"number","minimum":0,"maximum":20,"default":0.3,"description":"A page with less ink than this share of its area, in percent, is blank, 0 to 20 (default 0.3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"margin":{"type":"number","minimum":0,"maximum":40,"default":5,"description":"The border of each page that is not looked at, in percent of its size, 0 to 40 (default 5). Hides scanner shadows and punch holes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"white_level":{"type":"integer","minimum":50,"maximum":254,"default":200,"description":"Pixels darker than this (0 to 255, default 200) count as ink.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"ignore_specks":{"type":"number","minimum":0,"maximum":5,"default":1,"description":"Remove specks of dust before counting, 0 to 5 (default 1; 0 = off).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"dpi":{"type":"integer","minimum":72,"maximum":400,"default":60,"description":"The resolution the pages are drawn at, 72 to 400 (default 60).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"keep_first":{"type":"boolean","default":false,"description":"true: never remove the first page. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"text_check":{"type":"boolean","default":false,"description":"true: keep a page that has text in its text layer, even if it looks empty (white text, tiny print). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"report_only":{"type":"boolean","default":false,"description":"true: do not remove anything; the answer lists the blank pages (wouldRemove) and the file is unchanged. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/remove-blank.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, pagesIn, pagesOut, removed, wouldRemove, changed, pages: [{ page, inkPercent, blank, kept, reason? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"pagesIn":{"type":"integer"},"pagesOut":{"type":"integer"},"removed":{"type":"array","items":{"type":"integer"},"description":"The page numbers that were taken out."},"wouldRemove":{"type":"array","items":{"type":"integer"},"description":"The blank pages found (the same as removed, unless report_only)."},"changed":{"type":"boolean"},"pages":{"type":"array","items":{"type":"object"},"description":"Every page: page, inkPercent (null when not checked), blank, kept and a reason when it was kept although blank or not checked."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","pagesIn","pagesOut","removed","wouldRemove","changed","pages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.remove-blank","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/remove-blank\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=1-3' \\\n  -F 'threshold=0.3' \\\n  -F 'margin=5'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.removeBlank({\n    \"file\": 'document.pdf',\n    \"pages\": \"1-3\",\n    \"threshold\": 0.3,\n    \"margin\": 5\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->removeBlank([\n    'file' => 'document.pdf',\n    'pages' => '1-3',\n    'threshold' => 0.3,\n    'margin' => 5,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/replace-text":{"post":{"operationId":"pdfs.replace-text","summary":"Find and replace text in a PDF","description":"Find text in a PDF and write other text in its place: each found run is covered with a patch of the paper colour and the new text is drawn over it in a standard font, shrunk to fit. By default the changed pages are drawn as pictures so the old text is gone from the file.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to edit (it needs a text layer).","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"find":{"type":"string","example":"Acme Ltd","description":"The text to find (up to 200 characters). Use rules for several pairs.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"replace":{"type":"string","example":"Acme Inc","description":"The text to write instead (up to 200 characters; empty removes the text).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"rules":{"type":"array","example":"[{\"find\":\"2025\",\"replace\":\"2026\"}]","items":{"type":"object","properties":{"find":{"type":"string"},"replace":{"type":"string"}},"required":["find","replace"]},"description":"Several pairs at once: a list of { find, replace } (up to 30). Used instead of find and replace.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to change: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"case_sensitive":{"type":"boolean","default":false,"description":"true: upper and lower case differ. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"whole_word":{"type":"boolean","default":false,"description":"true: only match whole words. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"font":{"type":"string","enum":["helvetica","helvetica-bold","times","courier"],"default":"helvetica","description":"The font of the new text: helvetica (default), helvetica-bold, times or courier.","x-davix-h2i-enum":"PdfsFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"color":{"type":"string","format":"color","default":"#000000","description":"The colour of the new text as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"The colour of the patch over the old text, as a hex colour (default #ffffff: white paper). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"shrink_to_fit":{"type":"boolean","default":true,"description":"true (default): make the new text smaller when it is longer than the old text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"remove_original":{"type":"boolean","default":true,"description":"true (default): draw every changed page as a picture again so the old text is really gone. false: keep the text layer; the old text stays in the file under the patch.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"dpi":{"type":"integer","minimum":72,"maximum":300,"default":150,"description":"With remove_original: the resolution of the redrawn pages, 72 to 300 (default 150).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"max_replacements":{"type":"integer","minimum":1,"maximum":1000,"default":200,"description":"The most places to change, 1 to 1000 (default 200).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/replace-text.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"rules":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, replacements, pagesChanged, flattened, changed, details: [{ page, find, replace, text }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"replacements":{"type":"integer"},"pagesChanged":{"type":"array","items":{"type":"integer"},"description":"The pages that were changed."},"flattened":{"type":"boolean","description":"true when the changed pages were redrawn as pictures."},"changed":{"type":"boolean"},"details":{"type":"array","items":{"type":"object"},"description":"Each change: page, find, replace and the exact text that was found (up to 200)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","replacements","pagesChanged","flattened","changed","details"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.replace-text","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/replace-text\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'find=Acme Ltd' \\\n  -F 'replace=Acme Inc' \\\n  -F 'rules=[{\"find\":\"2025\",\"replace\":\"2026\"}]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.replaceText({\n    \"file\": 'document.pdf',\n    \"find\": \"Acme Ltd\",\n    \"replace\": \"Acme Inc\",\n    \"rules\": \"[{\\\"find\\\":\\\"2025\\\",\\\"replace\\\":\\\"2026\\\"}]\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->replaceText([\n    'file' => 'document.pdf',\n    'find' => 'Acme Ltd',\n    'replace' => 'Acme Inc',\n    'rules' => '[{\"find\":\"2025\",\"replace\":\"2026\"}]',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/sanitize":{"post":{"operationId":"pdfs.sanitize","summary":"Sanitize a PDF","description":"Remove what can run or leak from a PDF before you open or share it: scripts, launch and form-submit actions, embedded files, embedded media, web links and document details. The answer says what was removed.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"remove":{"type":"array","example":"[\"javascript\",\"attachments\",\"metadata\"]","items":{"type":"string","enum":["javascript","actions","attachments","embedded_media","links","metadata"],"x-davix-h2i-enum":"PdfsRemoveItem"},"description":"What to remove, a list of: javascript, actions, attachments, embedded_media, links, metadata. Default: javascript, actions, attachments, embedded_media. links removes web links (the text stays); metadata clears the title, author and other document details.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A name that is not in the list -> 400 invalid_parameter. Removed objects are dropped from the file itself, not just hidden.","evidence":"src/api/pdfs/pdf-safety.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"remove":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, removed: { javascript, actions, attachments, links, embeddedMedia, metadata }, itemsRemoved, parts, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"removed":{"type":"object","description":"How many of each were removed: javascript, actions, attachments, links, embeddedMedia; metadata is true when the document details were cleared."},"itemsRemoved":{"type":"integer"},"parts":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","removed","itemsRemoved","parts"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.sanitize","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/sanitize\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'remove=[\"javascript\",\"attachments\",\"metadata\"]' \\\n  -F 'validate_only=false' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.sanitize({\n    \"file\": 'document.pdf',\n    \"remove\": \"[\\\"javascript\\\",\\\"attachments\\\",\\\"metadata\\\"]\",\n    \"validate_only\": false,\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->sanitize([\n    'file' => 'document.pdf',\n    'remove' => '[\"javascript\",\"attachments\",\"metadata\"]',\n    'validate_only' => false,\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/search":{"post":{"operationId":"pdfs.search","summary":"Search in a PDF","description":"Find a word or phrase in a PDF text layer and get every match with its page, a little text around it and its position on the page. Optionally return a copy with every match highlighted.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"query":{"type":"string","maxLength":200,"example":"invoice number","description":"The word or phrase to find (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"pages":{"type":"string","example":"1-3","description":"Which pages: all (default), first, last, odd, even, or numbers and ranges such as \"1,3-5\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"case_sensitive":{"type":"boolean","default":false,"description":"true: \"Apple\" does not match \"apple\". Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"whole_word":{"type":"boolean","default":false,"description":"true: \"art\" does not match \"part\". Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"max_results":{"type":"integer","minimum":1,"maximum":1000,"default":200,"description":"At most this many matches are listed (default 200, up to 1000). The answer always gives the full count.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"context":{"type":"integer","minimum":0,"maximum":200,"default":40,"description":"How many characters of text to show before and after each match (default 40).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"highlight":{"type":"boolean","default":false,"description":"true: also return a copy of the PDF with every match highlighted (`url`). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","query"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ query, matches, pagesWithMatches, results: [{ page, text, before, after, rects: [{ x, y, width, height }] }], url?, sizeBytes?, highlighted?, warnings? }. Rectangles are in points from the top left of the page.","content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"matches":{"type":"integer","description":"How many matches there are in all (results may list fewer)."},"pagesWithMatches":{"type":"integer"},"results":{"type":"array","items":{"type":"object"},"description":"One per match: page, text, before, after (the text around it) and rects, the boxes of the match (x, y, width, height in points from the top left of the page; one per line the match runs over)."},"url":{"type":"string","format":"uri","description":"highlight=true: the PDF with every match highlighted."},"sizeBytes":{"type":"integer"},"highlighted":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["query","matches","pagesWithMatches","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.search","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/search\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'query=invoice number' \\\n  -F 'pages=1-3' \\\n  -F 'max_results=200'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.search({\n    \"file\": 'document.pdf',\n    \"query\": \"invoice number\",\n    \"pages\": \"1-3\",\n    \"max_results\": 200\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->search([\n    'file' => 'document.pdf',\n    'query' => 'invoice number',\n    'pages' => '1-3',\n    'max_results' => 200,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/security":{"post":{"operationId":"pdfs.security","summary":"Encrypt or decrypt a PDF","description":"Encrypt or decrypt a PDF","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"operation":{"type":"string","enum":["encrypt","decrypt"],"description":"encrypt or decrypt.","x-davix-h2i-enum":"PdfsSecurityOperation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/security.js"}},"userPassword":{"type":"string","format":"password","description":"Password required to open the PDF (encrypt).","x-davix-h2i-behavior":{"onMissing":"reject","evidence":"src/processing/pdfs/engine.js:encryptPdf"},"x-davix-h2i-required-when":[{"field":"operation","equals":"encrypt"}]},"ownerPassword":{"type":"string","format":"password","description":"Owner (permissions) password (encrypt). Defaults to the user password.","x-davix-h2i-depends-on":[{"field":"operation","equals":"encrypt"}]},"password":{"type":"string","format":"password","description":"Password of the PDF to decrypt.","x-davix-h2i-behavior":{"onMissing":"reject","evidence":"src/processing/pdfs/engine.js:decryptPdf"},"x-davix-h2i-required-when":[{"field":"operation","equals":"decrypt"}]},"keyLength":{"type":"integer","enum":[40,128,256],"default":256,"description":"Encryption key length (bits).","x-davix-h2i-enum":"PdfsKeyLength","x-davix-h2i-behavior":{"onInvalid":"reject","note":"40-bit supports only the coarse permission flags.","evidence":"src/processing/pdfs/engine.js:encryptPdf"},"x-davix-h2i-depends-on":[{"field":"operation","equals":"encrypt"}]},"permissions":{"type":"object","properties":{"print":{"type":"string","enum":["full","low","none"],"description":"Printing.","x-davix-h2i-enum":"PdfsPrint"},"modify":{"type":"string","enum":["all","annotate","form","assembly","none"],"description":"Modification (40-bit keys: any value other than none = restricted).","x-davix-h2i-enum":"PdfsModify"},"allowExtraction":{"type":"boolean","description":"true = allow extraction. (Inverted into the qpdf flag internally.)"},"allowAnnotations":{"type":"boolean","description":"Allow annotations."},"allowFormFilling":{"type":"boolean","description":"Allow form filling (not for 40-bit)."},"allowAssembly":{"type":"boolean","description":"Allow assembly (not for 40-bit)."},"allowAccessibility":{"type":"boolean","description":"Allow accessibility extraction (not for 40-bit)."}},"description":"Permissions for the encrypted PDF (JSON object).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:buildQpdfPermissionArgs"},"x-davix-h2i-depends-on":[{"field":"operation","equals":"encrypt"}]},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","operation"]},"encoding":{"permissions":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-actions":{"selector":"operation","style":"enum-field","items":[{"name":"encrypt","fields":["userPassword","ownerPassword","keyLength","permissions"],"requiredFields":["userPassword"]},{"name":"decrypt","fields":["password"],"requiredFields":["password"]}]},"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.security","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/security\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'operation=encrypt' \\\n  -F 'keyLength=256' \\\n  -F 'output_bundle=zip'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.security({\n    \"file\": 'document.pdf',\n    \"operation\": \"encrypt\",\n    \"keyLength\": 256,\n    \"output_bundle\": \"zip\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->security([\n    'file' => 'document.pdf',\n    'operation' => 'encrypt',\n    'keyLength' => 256,\n    'output_bundle' => 'zip',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/sign":{"post":{"operationId":"pdfs.sign","summary":"Add a genuine PKCS#7 digital signature to a PDF, using a caller-supplied certificate/key","description":"Add a genuine PKCS#7 digital signature to a PDF, using a caller-supplied certificate/key","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to sign.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"certificateId":{"type":"integer","minimum":1,"description":"The id of a certificate stored with POST /v1/certificates: sign with it instead of sending certPem and keyPem. Individual customer keys only. Not together with certPem/keyPem.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a positive integer -> 400 invalid_parameter; together with certPem/keyPem -> 400; someone else's or an unknown id -> 404 not_found; an expired certificate -> 400.","evidence":"src/api/pdfs/sign.js"}},"certPem":{"type":"string","format":"password","description":"PEM-encoded X.509 certificate (chain allowed). Required unless certificateId is given; never sent together with it.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a PEM certificate -> 400 invalid_parameter. Sent only for this request; never stored.","evidence":"src/processing/pdfs/engine.js:signPdf"}},"keyPem":{"type":"string","format":"password","description":"PEM-encoded RSA private key matching certPem. Required unless certificateId is given; never sent together with it.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a PEM RSA key or not matching -> 400. Never stored.","evidence":"src/processing/pdfs/engine.js:signPdf"}},"reason":{"type":"string","maxLength":500,"description":"Signing reason.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:signPdf"}},"signerName":{"type":"string","maxLength":200,"description":"Signer name.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:signPdf"}},"contactInfo":{"type":"string","maxLength":500,"description":"Signer contact info.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"ignore","note":"Truncated to the first 500 characters. Empty = not written.","evidence":"src/processing/pdfs/engine.js:signPdf"}},"location":{"type":"string","maxLength":500,"description":"Signing location.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"ignore","note":"Truncated to the first 500 characters. Empty = not written.","evidence":"src/processing/pdfs/engine.js:signPdf"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","not_found","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.sign","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/sign\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'certificateId=1' \\\n  -F 'output_bundle=zip' \\\n  -F 'response=url'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.sign({\n    \"file\": 'document.pdf',\n    \"certificateId\": 1,\n    \"output_bundle\": \"zip\",\n    \"response\": \"url\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->sign([\n    'file' => 'document.pdf',\n    'certificateId' => 1,\n    'output_bundle' => 'zip',\n    'response' => 'url',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/split":{"post":{"operationId":"pdfs.split","summary":"Split a PDF","description":"Cut one PDF into several: every N pages, at the top-level bookmarks, at blank separator pages, or into parts that stay under a file size.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"mode":{"type":"string","enum":["every","bookmarks","blank","size"],"description":"every, bookmarks, blank or size.","x-davix-h2i-enum":"PdfsSplitMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"every":{"type":"integer","minimum":1,"description":"mode=every: pages per part.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"},"x-davix-h2i-required-when":[{"field":"mode","equals":"every"}]},"level":{"type":"integer","minimum":1,"maximum":8,"default":1,"description":"mode=bookmarks: the bookmark level to split at (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"max_size_mb":{"type":"number","minimum":0.02,"description":"mode=size: the largest part, in MB (a single page larger than this is a part of its own and is reported).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"},"x-davix-h2i-required-when":[{"field":"mode","equals":"size"}]},"keep_blank":{"type":"boolean","default":false,"description":"mode=blank: keep the separator page at the start of the next part instead of dropping it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"prefix":{"type":"string","description":"File name prefix for the parts (default: the name of the uploaded file).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","mode"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ parts, results: [{ url, sizeBytes, part, fileName, pages, firstPage, lastPage, label? }], warnings? } — at most 500 parts; each part counts as one file.","content":{"application/json":{"schema":{"type":"object","properties":{"parts":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"part":{"type":"integer"},"fileName":{"type":"string"},"pages":{"type":"integer"},"firstPage":{"type":"integer"},"lastPage":{"type":"integer"},"label":{"type":"string"}},"required":["url","sizeBytes","part","fileName","pages","firstPage","lastPage"]}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["parts","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.split","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/split\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'mode=every' \\\n  -F 'every=1' \\\n  -F 'level=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.split({\n    \"file\": 'document.pdf',\n    \"mode\": \"every\",\n    \"every\": 1,\n    \"level\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->split([\n    'file' => 'document.pdf',\n    'mode' => 'every',\n    'every' => 1,\n    'level' => 1,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/split-by-code":{"post":{"operationId":"pdfs.split-by-code","summary":"Split scan by barcode","description":"Cut a scanned batch of documents into separate PDFs where a separator sheet with a barcode appears (or where the code value changes), each named from its code, as one ZIP.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The scanned batch as one PDF.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"mode":{"type":"string","enum":["separator","value"],"default":"separator","description":"separator (default): a page with a matching code starts a new document. value: a new document starts where the code value changes.","x-davix-h2i-enum":"PdfsSplitByCodeMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"pattern":{"type":"string","example":"SPLIT*","description":"Which codes count: a text with * (any text) and ? (one character), not case-sensitive, for example SPLIT* or INV-????. Default: any code.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"remove_separators":{"type":"boolean","default":true,"description":"With mode=separator: true (default) leaves the separator sheets out of the documents.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"unmatched":{"type":"string","enum":["previous","own"],"default":"previous","description":"With mode=value: a page with no code joins the document before it (previous, default) or becomes a document of its own (own).","x-davix-h2i-enum":"PdfsUnmatched","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"name_from_code":{"type":"boolean","default":true,"description":"true (default): name each file from its code (document-1, document-2 ... when there is none).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"prefix":{"type":"string","example":"scan-","description":"Text put before every file name (up to 40 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to look at for codes: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"dpi":{"type":"integer","minimum":72,"maximum":400,"default":150,"description":"The resolution the pages are drawn at before reading the codes, 72 to 400 (default 150).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"formats":{"type":"array","items":{"type":"string"},"description":"Only read these symbologies (default: all).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/split-by-code.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"formats":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, mode, parts: [{ name, code, pages, fromPage, toPage, pageNumbers, separatorPage, bytes }], documents, pagesIn, pagesOut, codesFound, warnings? }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["zip"]},"mode":{"type":"string","enum":["separator","value"]},"parts":{"type":"array","items":{"type":"object"},"description":"The documents in the ZIP: name, code (the code that started it), pages, fromPage, toPage, pageNumbers, separatorPage and bytes."},"documents":{"type":"integer"},"pagesIn":{"type":"integer"},"pagesOut":{"type":"integer","description":"The pages in all documents together (separator sheets are not counted when removed)."},"codesFound":{"type":"integer","description":"On how many pages a code was found."},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","mode","parts","documents","pagesIn","pagesOut","codesFound"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.split-by-code","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/split-by-code\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'mode=separator' \\\n  -F 'pattern=SPLIT*' \\\n  -F 'unmatched=previous'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.splitByCode({\n    \"file\": 'document.pdf',\n    \"mode\": \"separator\",\n    \"pattern\": \"SPLIT*\",\n    \"unmatched\": \"previous\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->splitByCode([\n    'file' => 'document.pdf',\n    'mode' => 'separator',\n    'pattern' => 'SPLIT*',\n    'unmatched' => 'previous',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/tables":{"post":{"operationId":"pdfs.tables","summary":"Extract tables from a PDF","description":"Find the tables of a PDF from the positions of its text and return them as JSON (default), one CSV table or an XLSX workbook with one sheet per table, with the confidence of each detection.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","description":"Pages: \"all\" (default), \"first\", \"last\", \"odd\", \"even\", or numbers and ranges such as \"1,3-5\" (1-based). A page outside the document -> 400.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"format":{"type":"string","enum":["json","csv","xlsx"],"default":"json","description":"json (default): tables inline; csv: one table as a CSV file (the first, or `table`); xlsx: every table (or `table`) as a sheet.","x-davix-h2i-enum":"PdfsTablesFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"table":{"type":"integer","minimum":1,"description":"The table number (as listed, 1-based) to write for csv / xlsx.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"min_confidence":{"type":"number","minimum":0,"maximum":1,"default":0.5,"description":"Drop detections below this confidence, 0 to 1 (default 0.5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"min_rows":{"type":"integer","minimum":2,"maximum":100,"default":2,"description":"Fewest rows a table must have (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-tools.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ tables: [{ index, page, rows, rowCount, columnCount, confidence, box, headerRow, headerIsGuess }], pagesScanned, pagesWithoutText, notes } for json; { url, sizeBytes, tablesFound, tablesWritten, tables, warnings } for csv / xlsx.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"tables":{"type":"array","items":{"type":"object"},"description":"Each table: index, page, rows (array of rows of strings), rowCount, columnCount, confidence (0-1), box, headerRow, headerIsGuess."},"pagesScanned":{"type":"integer"},"pagesWithoutText":{"type":"array","items":{"type":"integer"}},"notes":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["tables","pagesScanned","pagesWithoutText","notes"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"tablesFound":{"type":"integer"},"tablesWritten":{"type":"integer"},"tables":{"type":"array","items":{"type":"object"}},"pagesWithoutText":{"type":"array","items":{"type":"integer"}},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","tablesFound","tablesWritten","tables","pagesWithoutText","warnings"]}]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.tables","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/tables\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'format=json' \\\n  -F 'table=1' \\\n  -F 'min_confidence=0.5'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.tables({\n    \"file\": 'document.pdf',\n    \"format\": \"json\",\n    \"table\": 1,\n    \"min_confidence\": 0.5\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->tables([\n    'file' => 'document.pdf',\n    'format' => 'json',\n    'table' => 1,\n    'min_confidence' => 0.5,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/text":{"post":{"operationId":"pdfs.text","summary":"Extract the PDF text layer (not OCR), optionally as heuristic Markdown or HTML","description":"Extract the PDF text layer (not OCR), optionally as heuristic Markdown or HTML","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to read (text layer only; this is not OCR).","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","pattern":"^(all|first|\\s*\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*\\s*)$","default":"all","description":"Pages: \"all\", \"first\", or a comma list of pages/ranges such as \"1,3-5\" (1-based). Default = all pages.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Lenient parser: out-of-range pages are dropped/clamped to the document; if nothing valid remains the result falls back to page 1 (it does NOT return an error).","evidence":"src/processing/pdfs/engine.js:parsePageNumbers"}},"layout":{"type":"boolean","description":"Preserve physical layout (pdftotext -layout). Only used for format=text.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" (case-insensitive) counts as true; any other value = false","evidence":"src/api/pdfs/text.js"}},"format":{"type":"string","enum":["text","markdown","html"],"default":"text","description":"text = plain text; markdown/html = heuristic structure reconstruction.","x-davix-h2i-enum":"PdfsTextFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/pdfs/text.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"pageCount":{"type":"integer"},"pagesExtracted":{"type":"integer"},"pages":{"type":"array","items":{"type":"object","properties":{"pageNumber":{"type":"integer"},"text":{"type":"string"},"charCount":{"type":"integer"}},"required":["pageNumber","text","charCount"]}},"fullText":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["pageCount","pagesExtracted","pages","fullText"]},{"type":"object","properties":{"format":{"type":"string"},"pageCount":{"type":"integer"},"pagesConverted":{"type":"integer"},"blockCount":{"type":"integer"},"headingCount":{"type":"integer"},"content":{},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["format","pageCount","pagesConverted","blockCount","headingCount","content"]}],"description":"Plain extraction -> {pageCount,pagesExtracted,pages[],fullText}; structured output (markdown/html/json) -> {format,pageCount,pagesConverted,blockCount,headingCount,content}."}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.text","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_split_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/text\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=all' \\\n  -F 'layout=true' \\\n  -F 'format=text'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.text({\n    \"file\": 'document.pdf',\n    \"pages\": \"all\",\n    \"layout\": true,\n    \"format\": \"text\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->text([\n    'file' => 'document.pdf',\n    'pages' => 'all',\n    'layout' => true,\n    'format' => 'text',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/to-images":{"post":{"operationId":"pdfs.to-images","summary":"Rasterize PDF pages to images","description":"Rasterize PDF pages to images","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to rasterize.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","pattern":"^(all|first|\\s*\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*\\s*)$","default":"all","description":"Pages: \"all\", \"first\", or a comma list of pages/ranges such as \"1,3-5\" (1-based). Default = all pages.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Lenient parser: out-of-range pages are dropped/clamped to the document; if nothing valid remains the result falls back to page 1 (it does NOT return an error).","evidence":"src/processing/pdfs/engine.js:parsePageNumbers"}},"format":{"type":"string","enum":["jpeg","jpg","png","webp"],"default":"png","description":"Image format (\"jpg\" is an alias of jpeg).","x-davix-h2i-enum":"PdfsToImagesFormat","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/processing/pdfs/engine.js:pdfToImages"}},"width":{"type":"integer","minimum":1,"description":"Scale output to this width (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels. Empty or 0 = not provided; a negative or non-numeric value -> 400 invalid_parameter. A size above what the plan may ask for (max_output_dimension_px, max_output_pixels) -> 400 invalid_parameter.","evidence":"src/processing/pdfs/engine.js:pdfToImages; src/shared/param-validation.js"}},"height":{"type":"integer","minimum":1,"description":"Scale output to this height (px).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number of pixels. Empty or 0 = not provided; a negative or non-numeric value -> 400 invalid_parameter. A size above what the plan may ask for (max_output_dimension_px, max_output_pixels) -> 400 invalid_parameter.","evidence":"src/processing/pdfs/engine.js:pdfToImages; src/shared/param-validation.js"}},"dpi":{"type":"integer","minimum":1,"default":150,"description":"Rasterization resolution.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number >= 1. Empty or 0 -> 150. A non-numeric or negative value -> 400 invalid_parameter. Above the plan's max_pdf_dpi, or a page that would render larger than the plan's result-size limits -> 400 invalid_parameter.","evidence":"src/processing/pdfs/engine.js:pdfToImages; src/shared/param-validation.js"}},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"pageNumber":{"type":"integer"}},"required":["url","format","sizeBytes","pageNumber"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.to-images","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_to_images_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","max_output_dimension_px","max_output_pixels","max_pdf_dpi","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/to-images\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'format=png' \\\n  -F 'width=800' \\\n  -F 'height=600'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.toImages({\n    \"file\": 'document.pdf',\n    \"format\": \"png\",\n    \"width\": 800,\n    \"height\": 600\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->toImages([\n    'file' => 'document.pdf',\n    'format' => 'png',\n    'width' => 800,\n    'height' => 600,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/to-long-image":{"post":{"operationId":"pdfs.to-long-image","summary":"PDF to one long image","description":"Stack the chosen pages of a PDF top to bottom into one tall picture (PNG, JPEG or WebP): a scrolling screenshot of the document for chats, web pages and social posts.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to turn into a picture.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"pages":{"type":"string","default":"all","example":"1-3","description":"The pages to draw: all (default), first, last, odd, even, or numbers and ranges such as 1,3-5.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"dpi":{"type":"integer","minimum":36,"maximum":300,"default":100,"description":"The resolution the pages are drawn at, 36 to 300 (default 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"width":{"type":"integer","minimum":100,"maximum":4000,"description":"Scale every page to this width in pixels, 100 to 4000 (default: the drawn width).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"gap":{"type":"integer","minimum":0,"maximum":400,"default":0,"description":"The space between pages in pixels, 0 to 400 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"gap_color":{"type":"string","format":"color","default":"#e5e7eb","example":"#e5e7eb","description":"The colour of the space between pages, as a hex colour (default #e5e7eb). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"background":{"type":"string","format":"color","default":"#ffffff","description":"The colour behind transparent page areas, as a hex colour (default #ffffff). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"png (default), jpeg or webp. JPEG and WebP have a height limit (65535 and 16383 pixels).","x-davix-h2i-enum":"Format","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"default":85,"description":"With jpeg or webp: the quality, 1 to 100 (default 85).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"max_height":{"type":"integer","minimum":500,"maximum":100000,"default":65000,"description":"Refuse a picture taller than this many pixels, 500 to 100000 (default 65000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/to-long-image.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ url, sizeBytes, format, width, height, pagesDrawn, pages: [{ page, top, height }] }","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"sizeBytes":{"type":"integer"},"format":{"type":"string","enum":["png","jpeg","webp"]},"width":{"type":"integer"},"height":{"type":"integer"},"pagesDrawn":{"type":"integer"},"pages":{"type":"array","items":{"type":"object"},"description":"Where each page starts in the picture: page, top, height (pixels)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url","sizeBytes","format","width","height","pagesDrawn","pages"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.to-long-image","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/to-long-image\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'pages=1-3' \\\n  -F 'dpi=100' \\\n  -F 'width=800'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.toLongImage({\n    \"file\": 'document.pdf',\n    \"pages\": \"1-3\",\n    \"dpi\": 100,\n    \"width\": 800\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->toLongImage([\n    'file' => 'document.pdf',\n    'pages' => '1-3',\n    'dpi' => 100,\n    'width' => 800,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/validate":{"post":{"operationId":"pdfs.validate","summary":"Validate PDF/A and accessibility","description":"Check a PDF against PDF/A (archiving), PDF/UA (accessibility) and the accessibility basics (tags, language, title) in one call, with one pass or fail answer and the rules that failed.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"standards":{"type":"array","example":"[\"pdfa\",\"pdfua\"]","items":{"type":"string","enum":["pdfa","pdfua","accessibility"],"x-davix-h2i-enum":"PdfsStandardsItem"},"description":"What to check, a list of: pdfa, pdfua, accessibility. Default: pdfa and accessibility.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"pdfa_flavour":{"type":"string","enum":["auto","1a","1b","2a","2b","2u","3a","3b","3u"],"default":"auto","description":"The PDF/A flavour to check against: auto (default, the one the file claims), 1a, 1b, 2a, 2b, 2u, 3a, 3b or 3u.","x-davix-h2i-enum":"PdfsValidatePdfaFlavour","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/pdfs/pdf-safety.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"standards":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ valid, summary: [{ standard, passed, message, profile?, failedRules?, issues? }], results: { pdfa?, pdfua?, accessibility? } }","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"summary":{"type":"array","items":{"type":"object"},"description":"One line per standard: standard (pdfa, pdfua, accessibility), passed, message, and profile, failedRules or issues."},"results":{"type":"object","description":"The full reports: pdfa and pdfua (profile, passedRules, failedRules and the failed rules with an example) and accessibility (tagged, language, title and its issues)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["valid","summary","results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.validate","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/validate\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'standards=[\"pdfa\",\"pdfua\"]' \\\n  -F 'pdfa_flavour=auto' \\\n  -F 'validate_only=false'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.validate({\n    \"file\": 'document.pdf',\n    \"standards\": \"[\\\"pdfa\\\",\\\"pdfua\\\"]\",\n    \"pdfa_flavour\": \"auto\",\n    \"validate_only\": false\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->validate([\n    'file' => 'document.pdf',\n    'standards' => '[\"pdfa\",\"pdfua\"]',\n    'pdfa_flavour' => 'auto',\n    'validate_only' => false,\n]);\necho $result->requestId;"}]}},"/v1/pdfs/verify-signature":{"post":{"operationId":"pdfs.verify-signature","summary":"Verify the digital signatures of a PDF","description":"Report every signature of a PDF: signer, signing time, hash algorithm, whether the signed bytes are intact, whether the signature covers the whole document and whether the certificate is trusted by this server. The file is not changed.","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to analyze.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ signed, count, allSignaturesValid, signatures: [{ index, signer, signingTime, hashAlgorithm, validity, certificateStatus, coversWholeDocument, signedRanges }], signatureFields, unsignedFields, notes }","content":{"application/json":{"schema":{"type":"object","properties":{"signed":{"type":"boolean"},"count":{"type":"integer"},"allSignaturesValid":{"type":"boolean"},"signatures":{"type":"array","items":{"type":"object"},"description":"Per signature: index, signer, signerDistinguishedName, signingTime, hashAlgorithm, signatureType, coversWholeDocument, signedRanges, validity (valid | digest-mismatch | invalid | unknown), certificateStatus (trusted | not-trusted | revoked | expired | untrusted-issuer | unknown)."},"signatureFields":{"type":"array","items":{"type":"object"}},"unsignedFields":{"type":"integer"},"engine":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["signed","count","allSignaturesValid","signatures","signatureFields","unsignedFields","engine","notes"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.verify-signature","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/verify-signature\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'validate_only=false' \\\n  -F 'presetId=00000000-0000-4000-8000-000000000000' \\\n  -F 'app=x'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.verifySignature({\n    \"file\": 'document.pdf',\n    \"validate_only\": false,\n    \"presetId\": \"00000000-0000-4000-8000-000000000000\",\n    \"app\": \"x\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->verifySignature([\n    'file' => 'document.pdf',\n    'validate_only' => false,\n    'presetId' => '00000000-0000-4000-8000-000000000000',\n    'app' => 'x',\n]);\necho $result->requestId;"}]}},"/v1/pdfs/watermark":{"post":{"operationId":"pdfs.watermark","summary":"Watermark every page of a PDF, or overlay/underlay another PDF onto it","description":"Watermark every page of a PDF, or overlay/underlay another PDF onto it","tags":["PDFs"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The PDF to watermark.","x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"],"note":"Only application/pdf is accepted (415 unsupported_media_type otherwise). Maximum file size and PDF page limits are plan/settings limits (runtime), see GET /v1/usage. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"watermarkText":{"type":"string","description":"Text drawn on each selected page. Mutually exclusive with pageNumberTemplate.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"At least one of watermarkText, watermarkImage or pageNumberTemplate is required (mode=stamp).","evidence":"src/api/pdfs/watermark.js"},"x-davix-h2i-conflicts-with":["pageNumberTemplate"]},"watermarkImage":{"type":"string","format":"binary","description":"PNG or JPEG image stamped on each selected page.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png"],"extensions":["jpg","jpeg","jpe","jfif","png"],"note":"Non-PNG images are embedded as JPEG."}},"pages":{"type":"string","pattern":"^(all|first|\\s*\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*\\s*)$","default":"all","description":"Pages: \"all\", \"first\", or a comma list of pages/ranges such as \"1,3-5\" (1-based). Default = all pages.","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Lenient parser: out-of-range pages are dropped/clamped to the document; if nothing valid remains the result falls back to page 1 (it does NOT return an error).","evidence":"src/processing/pdfs/engine.js:parsePageNumbers"}},"opacity":{"type":"number","minimum":0,"maximum":1,"default":0.3,"description":"Watermark opacity.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Number from 0 to 1; anything else -> 400 invalid_parameter.","evidence":"src/processing/pdfs/engine.js:watermarkPdf; src/shared/param-validation.js"}},"margin":{"type":"integer","minimum":0,"maximum":5000,"default":24,"description":"Edge margin (points).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number from 0 to 5000; anything else -> 400 invalid_parameter.","evidence":"src/processing/pdfs/engine.js:watermarkPdf; src/shared/param-validation.js"}},"position":{"type":"string","enum":["center","top-left","top-right","bottom-left","bottom-right","top","bottom","left","right"],"default":"center","description":"Placement.","x-davix-h2i-enum":"WatermarkPosition","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","evidence":"src/api/pdfs/watermark.js"}},"fontSize":{"type":"integer","minimum":1,"maximum":400,"default":24,"description":"Text size (points).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Whole number from 1 to 400; anything else -> 400 invalid_parameter.","evidence":"src/processing/pdfs/engine.js:watermarkPdf; src/shared/param-validation.js"}},"color":{"type":"string","format":"color","default":"#000000","description":"Text color. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Invalid hex -> 400.","evidence":"src/processing/shared/watermark-geometry.js:validateHexColor"}},"watermarkScale":{"type":"number","minimum":0.01,"maximum":1,"default":0.25,"description":"Image size as a fraction of the smaller page dimension.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Number from 0.01 to 1; anything else -> 400 invalid_parameter.","evidence":"src/processing/pdfs/engine.js:watermarkPdf; src/shared/param-validation.js"}},"pageNumberTemplate":{"type":"string","maxLength":200,"example":"Page {page} of {totalPages}","description":"Page-number text; {page} and {totalPages} are substituted. Mutually exclusive with watermarkText.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Must be a string of at most 200 characters (400 otherwise).","evidence":"src/api/pdfs/watermark.js"},"x-davix-h2i-conflicts-with":["watermarkText"]},"mode":{"type":"string","enum":["stamp","overlay","underlay"],"default":"stamp","description":"stamp = text/image/page numbers; overlay/underlay = place another PDF (overlayFile) over/under each page.","x-davix-h2i-enum":"PdfsWatermarkMode","x-davix-h2i-behavior":{"onInvalid":"fallback","note":"Any other value behaves as \"stamp\".","evidence":"src/api/pdfs/watermark.js"}},"overlayFile":{"type":"string","format":"binary","description":"The PDF to overlay/underlay (required for mode=overlay|underlay).","x-davix-h2i-required-when":[{"field":"mode","in":["overlay","underlay"]}],"x-davix-h2i-file":{"mimeTypes":["application/pdf"],"extensions":["pdf"]}},"to":{"type":"string","description":"Page-range of the target pages (overlay/underlay), e.g. \"1-z\".","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Must be valid Page-range syntax.","evidence":"src/processing/pdfs/engine.js:overlayPdf"},"x-davix-h2i-depends-on":[{"field":"mode","in":["overlay","underlay"]}]},"from":{"type":"string","description":"Page-range of the source pages taken from overlayFile.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:overlayPdf"},"x-davix-h2i-depends-on":[{"field":"mode","in":["overlay","underlay"]}]},"repeat":{"type":"string","description":"Page-range of overlay pages to repeat after the source pages run out.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/pdfs/engine.js:overlayPdf"},"x-davix-h2i-depends-on":[{"field":"mode","in":["overlay","underlay"]}]},"output_bundle":{"type":"string","enum":["zip"],"description":"zip = return the result files of this request as ONE zip download (`bundle.url`) instead of one signed URL per file. It applies when the request produces two or more files (several input files, or an operation with several outputs); with a single result file the normal answer is returned. The files in `results` then carry `bundleEntry` (their place in the zip) instead of `url`. Not available together with `async: true`.","x-davix-h2i-enum":"OutputBundle","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any value other than zip -> 400 invalid_parameter. Combined with async: true -> 400 invalid_parameter. Results above 300 MB in total are not bundled: the answer lists the files as usual and carries `bundle_error`.","evidence":"src/platform/uploads/bundle.js; src/platform/processing-hooks/index.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["url"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","pdf_page_limit_exceeded","pdf_tool_failed","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"pdfs.watermark","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"pdf","rateLimitCategory":"pdf","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","pdf_pages_split_max","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/pdfs/watermark\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'opacity=0.3' \\\n  -F 'margin=24' \\\n  -F 'position=center'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.pdfs.watermark({\n    \"file\": 'document.pdf',\n    \"opacity\": 0.3,\n    \"margin\": 24,\n    \"position\": \"center\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->pdfs()->watermark([\n    'file' => 'document.pdf',\n    'opacity' => 0.3,\n    'margin' => 24,\n    'position' => 'center',\n]);\necho $result->requestId;"}]}},"/v1/presets":{"get":{"operationId":"presets","summary":"List presets","description":"List presets","tags":["Presets"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"endpoint","in":"query","required":false,"schema":{"type":"string"},"description":"Only return presets saved for this endpoint id, e.g. images.resize."}],"responses":{"200":{"description":"Your presets in `results`, plus `limit` (how many presets your plan keeps; null = no limit) and `endpoints` (the operations your plan allows presets for; null = every operation).","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Preset"}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"presets","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/presets?endpoint=example\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.presets.list({\n    \"endpoint\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->presets()->list([\n    'endpoint' => 'example',\n]);\necho $result->requestId;"}]},"post":{"operationId":"presets.post","summary":"Create a preset","description":"Create a preset","tags":["Presets"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Preset name (1-100 characters after trimming); unique per owner and endpoint.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","normalization":"trimmed","note":"Duplicate name for the same endpoint -> 409 duplicate_preset_name. At most 200 presets per owner.","evidence":"src/processing/presets/service.js:validateName"}},"endpoint":{"type":"string","description":"Id of the processing endpoint this preset is for, e.g. images.resize or pdfs.merge (see GET /v1/registry)."},"parameters":{"type":"object","description":"The saved parameter values, keyed by the endpoint's own field names (file fields and presetId cannot be saved). Values are validated by the endpoint when the preset is used."}},"required":["name","endpoint","parameters"]}}}},"responses":{"201":{"description":"The created preset.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Preset"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","duplicate_preset_name","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"presets.post","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/presets\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"x\",\"endpoint\":\"example\",\"parameters\":{}}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.presets.create({\n    \"name\": \"x\",\n    \"endpoint\": \"example\",\n    \"parameters\": {}\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->presets()->create([\n    'name' => 'x',\n    'endpoint' => 'example',\n    'parameters' => [\n\n    ],\n]);\necho $result->requestId;"}]}},"/v1/presets/{id}":{"delete":{"operationId":"presets._id_.delete","summary":"Delete a preset","description":"Delete a preset","tags":["Presets"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Preset id (UUID)."}],"responses":{"204":{"description":"Deleted. No response body."},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"presets.{id}.delete","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X DELETE \"$DAVIX_H2I_URL/v1/presets/00000000-0000-4000-8000-000000000000\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.presets.delete({\n    \"id\": \"00000000-0000-4000-8000-000000000000\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->presets()->delete([\n    'id' => '00000000-0000-4000-8000-000000000000',\n]);\necho $result->requestId;"}]},"get":{"operationId":"presets._id_","summary":"Read a preset","description":"Read a preset","tags":["Presets"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Preset id (UUID)."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Preset"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"presets.{id}","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/presets/00000000-0000-4000-8000-000000000000\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.presets.get({\n    \"id\": \"00000000-0000-4000-8000-000000000000\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->presets()->get([\n    'id' => '00000000-0000-4000-8000-000000000000',\n]);\necho $result->requestId;"}]},"put":{"operationId":"presets._id_.put","summary":"Update a preset","description":"Update a preset","tags":["Presets"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Preset id (UUID)."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Preset name (1-100 characters after trimming); unique per owner.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","normalization":"trimmed","note":"Duplicate name -> 409 duplicate_preset_name. At most 100 presets per owner.","evidence":"src/processing/presets/service.js:validateName"}},"parameters":{"type":"object","description":"Replaces the saved parameter values (the endpoint itself never changes)."}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Preset"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","duplicate_preset_name","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","not_found"],"x-davix-h2i-id":"presets.{id}.put","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X PUT \"$DAVIX_H2I_URL/v1/presets/00000000-0000-4000-8000-000000000000\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"x\",\"parameters\":{}}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.presets.update({\n    \"id\": \"00000000-0000-4000-8000-000000000000\",\n    \"name\": \"x\",\n    \"parameters\": {}\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->presets()->update([\n    'id' => '00000000-0000-4000-8000-000000000000',\n    'name' => 'x',\n    'parameters' => [\n\n    ],\n]);\necho $result->requestId;"}]}},"/v1/registry":{"get":{"operationId":"registry","summary":"The one authoritative endpoint registry: every public endpoint with its full parameter schema, quota bucket and job-eligibility flag. Studio builds its operation sidebar and parameter forms from it.","description":"The one authoritative endpoint registry: every public endpoint with its full parameter schema, quota bucket and job-eligibility flag. Studio builds its operation sidebar and parameter forms from it.","tags":["Meta"],"security":[],"responses":{"200":{"description":"{ endpoints: [...] }.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoints":{"type":"array","items":{"type":"object"}}},"required":["endpoints"]}}}}},"x-davix-h2i-id":"registry","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/registry\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.registry.get();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->registry()->get();\necho $result->requestId;"}]}},"/v1/registry/endpoints/{id}":{"get":{"operationId":"registry.endpoints._id_","summary":"Registry: one entry","description":"One registry entry (parameters, quota bucket, job eligibility).","tags":["Meta"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._{}-]{1,120}$"},"description":"A registry endpoint id, e.g. images.resize."}],"responses":{"200":{"description":"One registry entry (parameters, quota bucket, job eligibility).","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"method":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"parameters":{"type":"array","items":{"type":"object"}}},"required":["id","path","method","category","parameters"],"additionalProperties":true}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["invalid_parameter","not_found"],"x-davix-h2i-id":"registry.endpoints.{id}","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/registry/endpoints/example\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.meta.registryEndpoint({\n    \"id\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->meta()->registryEndpoint([\n    'id' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/render/calendar":{"post":{"operationId":"render.calendar","summary":"Calendar page","description":"Make a printable calendar page: a month, a whole year or a week planner, with the week starting on the day you choose, week numbers, marked weekends and holidays, your own events, notes and room to write, in any language of the system calendar names.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"view":{"type":"string","enum":["month","year","week"],"default":"month","description":"month (default), year or week.","x-davix-h2i-enum":"RenderCalendarView","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"year":{"type":"integer","minimum":1900,"maximum":2200,"description":"The year, 1900 to 2200 (default this year).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"month":{"type":"integer","minimum":1,"maximum":12,"description":"The month, 1 to 12 (default this month). A week view shows the week of the 1st unless date is set.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"date":{"type":"string","example":"2026-11-18","description":"week view: a day in the week to show.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"locale":{"type":"string","default":"en-US","example":"de-DE","description":"The language of month and day names, as a language tag such as en-US (default), de-DE or fr-FR.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"week_start":{"type":"string","enum":["monday","sunday","saturday"],"default":"monday","description":"monday (default), sunday or saturday.","x-davix-h2i-enum":"RenderWeekStart","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"week_numbers":{"type":"boolean","default":false,"description":"true: a column with the ISO week numbers. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"mark_weekends":{"type":"boolean","default":true,"description":"true (default): shade the weekend days.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"weekend_days":{"type":"array","example":"[5,6]","items":{"type":"string"},"description":"Which days are the weekend, 0 (Sunday) to 6 (Saturday) (default 0 and 6).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"adjacent_days":{"type":"boolean","default":true,"description":"true (default): show the days of the neighbouring months in the first and last week.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"events":{"type":"array","example":"[{\"date\":\"2026-11-17\",\"title\":\"Kickoff\"}]","items":{"type":"object","properties":{"date":{"type":"string"},"title":{"type":"string"},"end":{"type":"string"},"color":{"type":"string","format":"color","description":"Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."}},"required":["date"]},"description":"Events written into the days: a list of { date, title, end?, color? }. An event with an end spans the days.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"holidays":{"type":"array","example":"[\"2026-12-25 Christmas\"]","items":{"type":"string"},"description":"Holidays as \"2026-12-25 Christmas\" lines: the day is tinted and the name written in.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"today":{"type":"string","example":"2026-11-18","description":"Circle this day.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"ruled_lines":{"type":"boolean","default":false,"description":"true: ruled lines in the days to write on. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"notes":{"type":"string","example":"Bring cake","description":"A text printed under the calendar (up to 2000 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"accent":{"type":"string","format":"color","example":"#e11d48","description":"The accent colour as a hex colour (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"paper":{"type":"string","enum":["a4","letter","a3"],"default":"a4","description":"a4 (default), letter or a3.","x-davix-h2i-enum":"RenderPaper","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"orientation":{"type":"string","enum":["landscape","portrait"],"default":"landscape","description":"landscape (default) or portrait.","x-davix-h2i-enum":"RenderCalendarOrientation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/calendar-page.js"}},"output":{"type":"string","enum":["png","pdf"],"default":"png","description":"png (default) or pdf.","x-davix-h2i-enum":"RenderOutput4","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","warm","mono"],"default":"light","description":"The colours: light, dark, warm, mono (default light).","x-davix-h2i-enum":"RenderTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"palette":{"type":"string","enum":["default","pastel","vivid","mono","ocean","sunset"],"default":"default","description":"The colours of the data: default, pastel, vivid, mono, ocean, sunset (default default).","x-davix-h2i-enum":"RenderPalette","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"font":{"type":"string","enum":["sans","serif","mono","rounded","hand"],"default":"sans","description":"The font: sans, serif, mono, rounded, hand (default sans).","x-davix-h2i-enum":"RenderFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"background":{"type":"string","format":"color","example":"#fffaf0","description":"The background as a hex colour (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"title":{"type":"string","example":"Team plan","description":"A title instead of the month name (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"subtitle":{"type":"string","example":"Q4","description":"A line under the title (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"weekend_days":{"contentType":"application/json"},"events":{"contentType":"application/json"},"holidays":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, view, year, month?, events, holidays }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","description":"The width of the picture or page in pixels."},"height":{"type":"integer","description":"The height of the picture or page in pixels."},"view":{"type":"string","enum":["month","year","week"]},"year":{"type":"integer"},"month":{"type":"integer","description":"The month (not in a year view)."},"events":{"type":"integer"},"holidays":{"type":"integer"}},"required":["url","format","sizeBytes","view","year","events","holidays"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.calendar","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/calendar\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'view=month' \\\n  -F 'year=1900' \\\n  -F 'month=1'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.calendar({\n    \"view\": \"month\",\n    \"year\": 1900,\n    \"month\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->calendar([\n    'view' => 'month',\n    'year' => 1900,\n    'month' => 1,\n]);\necho $result->requestId;"}]}},"/v1/render/chart":{"post":{"operationId":"render.chart","summary":"Render a chart from data","description":"A chart from a few simple fields (type, data, x, y, color) or a Vega-Lite specification, as SVG, PNG, JPEG, WebP, AVIF or PDF. The rows can be sent inline (data), or uploaded / fetched as a CSV, TSV, spreadsheet (XLSX, ODS) or JSON file (data_file, or its web address).","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["bar","line","area","scatter","pie","donut","stacked-bar","grouped-bar","histogram"],"description":"bar (default), line, area, scatter, pie, donut, stacked-bar, grouped-bar or histogram (simple mode).","x-davix-h2i-enum":"Type","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"data":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true},"description":"Simple mode: the rows, e.g. [{ \"month\": \"Jan\", \"sales\": 12 }, ...] (up to 50,000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"data_file":{"type":"array","items":{"type":"string","format":"binary"},"description":"Simple mode: a CSV, TSV, XLSX, ODS or JSON file to use as the rows instead of data (first sheet; the first row is the column names; up to 50,000 rows). Send the file, or its web address in data_file_url.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Send either data or data_file, not both. A file works with the simple fields (type, x, y), not with spec. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"x":{"type":"string","description":"Simple mode: the field on the x axis (the categories for a pie).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"},"x-davix-h2i-required-when":[{"field":"spec","present":false}]},"y":{"type":"string","description":"Simple mode: the field on the y axis (the values for a pie).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"color":{"type":"string","description":"Simple mode: a field that colours / groups the marks.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"},"x-davix-h2i-required-when":[{"field":"type","equals":"grouped-bar"},{"field":"spec","present":false}]},"title":{"type":"string","description":"Chart title.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"spec":{"type":"object","properties":{},"additionalProperties":true,"description":"A Vega-Lite specification instead of the simple fields. Expressions run in a safe interpreter; `url` in data or marks is refused.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"output":{"type":"string","enum":["svg","png","jpeg","webp","avif","pdf"],"default":"png","description":"png (default), svg, jpeg, webp, avif or pdf.","x-davix-h2i-enum":"RenderOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"width":{"type":"integer","minimum":50,"maximum":4000,"description":"Chart width in pixels, 50 to 4000 (default 600).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"height":{"type":"integer","minimum":50,"maximum":4000,"description":"Chart height in pixels, 50 to 4000 (default 400).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark"],"default":"light","description":"light (default) or dark.","x-davix-h2i-enum":"Theme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"jpeg / webp / avif quality, 1-100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"lang":{"type":"string","description":"Language tag for scripts with regional forms.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"data_file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"data":{"contentType":"application/json"},"spec":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"}},"required":["url","format","sizeBytes","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"data_file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.chart","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/chart\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'type=bar' \\\n  -F 'output=png' \\\n  -F 'width=800'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.chart({\n    \"type\": \"bar\",\n    \"output\": \"png\",\n    \"width\": 800\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->chart([\n    'type' => 'bar',\n    'output' => 'png',\n    'width' => 800,\n]);\necho $result->requestId;"}]}},"/v1/render/code":{"post":{"operationId":"render.code","summary":"Code to image","description":"Turn source code into a picture with syntax colours, line numbers and an optional window frame, ready for slides, documents and social posts. Over 190 languages, 13 colour themes.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"code":{"type":"string","maxLength":100000,"example":"function greet(name) {\n  return `Hello, ${name}!`;\n}","description":"The source code to show.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Missing -> 400 missing_field. More than 100,000 characters or 2,000 lines -> 400.","evidence":"src/processing/render/code-image.js"}},"language":{"type":"string","default":"auto","example":"javascript","description":"The programming language, for example javascript, python, html, css, sql, bash, java, go, php. Default auto: found from the code. \"text\" shows it without colours.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown language -> 400.","evidence":"src/processing/render/code-image.js"}},"output":{"type":"string","enum":["png","jpeg","webp","avif"],"default":"png","description":"png (default), jpeg, webp or avif.","x-davix-h2i-enum":"PictureOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["github-dark","github","one-dark","one-light","monokai","nord","dracula","night-owl","tokyo-night","solarized-dark","solarized-light","vs-dark","vs"],"default":"github-dark","description":"Colour theme: github-dark (default), github, one-dark, one-light, monokai, nord, dracula, night-owl, tokyo-night, solarized-dark, solarized-light, vs-dark or vs.","x-davix-h2i-enum":"RenderCodeTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/code-image.js"}},"title":{"type":"string","maxLength":120,"description":"A file name or title shown in the window bar, for example greet.js.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/code-image.js"}},"line_numbers":{"type":"boolean","default":false,"description":"true: show line numbers.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/code-image.js"}},"highlight_lines":{"type":"string","example":"2,5-7","description":"Lines to mark with a lighter band, for example 3 or 2,5-7.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not numbers and ranges -> 400.","evidence":"src/processing/render/code-image.js"}},"window":{"type":"boolean","default":true,"description":"true (default): draw the code in a window frame with three dots. false: no frame.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/code-image.js"}},"font_size":{"type":"number","minimum":8,"maximum":40,"default":14,"description":"Text size in pixels, 8 to 40 (default 14).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/code-image.js"}},"padding":{"type":"number","minimum":0,"maximum":200,"default":32,"description":"Space around the code window in pixels, 0 to 200 (default 32).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/code-image.js"}},"background":{"type":"string","format":"color","example":"#ffffff","description":"Colour behind the code window: #rgb, #rrggbb, #rrggbbaa or transparent (not with jpeg). Default #abb8c3. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Background colour. Anything that is not #rgb, #rrggbb, #rrggbbaa or transparent -> 400.","evidence":"src/processing/render/picture-params.js"}},"width":{"type":"number","minimum":200,"maximum":4000,"description":"A fixed width in pixels (200 to 4000): long lines wrap. Default: as wide as the longest line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/code-image.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"jpeg / webp / avif quality, 1-100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["code"]}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, language, lines }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"language":{"type":"string","description":"The language that was used (the guessed one with language=auto)."},"lines":{"type":"integer","description":"Lines of code shown."}},"required":["url","format","sizeBytes","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.code","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/code\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'code=function greet(name) {\n  return `Hello, ${name}!`;\n}' \\\n  -F 'language=javascript' \\\n  -F 'output=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.code({\n    \"code\": \"function greet(name) {\\n  return `Hello, ${name}!`;\\n}\",\n    \"language\": \"javascript\",\n    \"output\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->code([\n    'code' => 'function greet(name) {\n  return `Hello, ${name}!`;\n}',\n    'language' => 'javascript',\n    'output' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/render/data-report":{"post":{"operationId":"render.data-report","summary":"Data report","description":"Turn a table (CSV, Excel, JSON ...) into a finished report as a PDF or a picture: a title block, the size of the table, what every column holds, a histogram for each number column, the most common values of each text column and the first rows.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The table (CSV, TSV, JSON, Excel, ODS ... and the other formats the data tools read).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"sheet":{"type":"string","description":"Worksheet / table name to read (default: the first one). XLSX, ODS and XLS sheets, HTML and Markdown tables, SQL and SQLite tables.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown name -> 400 (details.available lists the names).","evidence":"src/processing/data/codecs.js"}},"delimiter":{"type":"string","description":"Field separator for CSV/TSV input and output: one character, or comma, semicolon, tab, pipe.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"More than one character (or a quote / line break) -> 400.","evidence":"src/processing/data/codecs.js"}},"encoding":{"type":"string","description":"Character encoding of CSV/TSV/text input and of CSV/TSV output, e.g. utf-8, utf-16le, iso-8859-1, windows-1252, shift_jis, gbk, big5, euc-kr. A byte order mark wins on input; without one a non-UTF-8 file is read as windows-1252 (reported in warnings).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown encoding -> 400.","evidence":"src/processing/data/codecs.js"}},"header":{"type":"boolean","default":true,"description":"true (default): the first row of the input holds column names, and CSV/TSV/HTML/Markdown/XLSX output gets a header row. false: columns are named column1, column2 ...","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"flatten":{"type":"boolean","default":true,"description":"true (default): nested JSON/XML/YAML objects become dotted columns (a.b.c) when written as a table; false keeps them as JSON text in one cell.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"infer_types":{"type":"boolean","default":true,"description":"true (default): numbers and true/false in text formats (CSV, TSV, HTML, Markdown) become numbers and booleans; values with leading zeros or that would lose precision stay text. false keeps every cell as text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/data/codecs.js"}},"sections":{"type":"array","example":"[\"summary\",\"charts\"]","items":{"type":"string"},"description":"Which sections and in what order: summary, columns, charts, preview, notes (default: summary, columns, charts, preview).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"columns":{"type":"array","example":"[\"region\",\"amount\"]","items":{"type":"string"},"description":"Only these columns (default: all).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"top_values":{"type":"integer","minimum":1,"maximum":20,"default":8,"description":"How many of the most common values to chart for a text column, 1 to 20 (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"bins":{"type":"integer","minimum":3,"maximum":60,"default":12,"description":"How many bars in a histogram, 3 to 60 (default 12).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"preview_rows":{"type":"integer","minimum":0,"maximum":100,"default":10,"description":"How many rows to show at the end, 0 to 100 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"max_charts":{"type":"integer","minimum":0,"maximum":60,"default":12,"description":"How many charts, 0 to 60 (default 12).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"decimals":{"type":"integer","minimum":0,"maximum":8,"default":2,"description":"How many decimals the numbers show, 0 to 8 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"notes":{"type":"string","example":"Check the East region","description":"A text for a Notes section (add notes to sections).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"source":{"type":"string","example":"crm.csv","description":"Where the data comes from, written under the title.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"show_date":{"type":"boolean","default":true,"description":"true (default): write today's date under the title.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"paper":{"type":"string","enum":["a4","letter","a3"],"default":"a4","description":"a4 (default), letter or a3.","x-davix-h2i-enum":"RenderPaper","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"landscape":{"type":"boolean","default":false,"description":"true: print in landscape. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"accent":{"type":"string","format":"color","example":"#e11d48","description":"The accent colour as a hex colour (default: from the palette). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/data-report.js"}},"output":{"type":"string","enum":["pdf","png"],"default":"pdf","description":"pdf (default) or png (one tall picture).","x-davix-h2i-enum":"RenderOutput2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"width":{"type":"integer","minimum":200,"maximum":4000,"default":900,"description":"png: the width in pixels, 200 to 4000 (default 900).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"height":{"type":"integer","minimum":100,"maximum":8000,"default":1200,"description":"The height of the page in pixels, 100 to 8000 (default 1200).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","warm","mono"],"default":"light","description":"The colours: light, dark, warm, mono (default light).","x-davix-h2i-enum":"RenderTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"palette":{"type":"string","enum":["default","pastel","vivid","mono","ocean","sunset"],"default":"default","description":"The colours of the data: default, pastel, vivid, mono, ocean, sunset (default default).","x-davix-h2i-enum":"RenderPalette","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"font":{"type":"string","enum":["sans","serif","mono","rounded","hand"],"default":"sans","description":"The font: sans, serif, mono, rounded, hand (default sans).","x-davix-h2i-enum":"RenderFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"background":{"type":"string","format":"color","example":"#ffffff","description":"The page colour as a hex colour (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"title":{"type":"string","example":"Sales report","description":"The title (default: the name of the sheet).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"subtitle":{"type":"string","example":"January","description":"A line under the title.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"sections":{"contentType":"application/json"},"columns":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, rows, columns, charts, emptyCells, pages?, warnings? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["pdf","png"]},"sizeBytes":{"type":"integer"},"rows":{"type":"integer"},"columns":{"type":"integer"},"charts":{"type":"integer"},"emptyCells":{"type":"integer"},"pages":{"type":"integer","description":"With pdf: how many pages the report fills."},"warnings":{"type":"array","items":{"type":"string"}}},"required":["url","format","sizeBytes","rows","columns","charts","emptyCells"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.data-report","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/data-report\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'sections=[\"summary\",\"charts\"]' \\\n  -F 'columns=[\"region\",\"amount\"]' \\\n  -F 'top_values=8'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.dataReport({\n    \"file\": 'document.pdf',\n    \"sections\": \"[\\\"summary\\\",\\\"charts\\\"]\",\n    \"columns\": \"[\\\"region\\\",\\\"amount\\\"]\",\n    \"top_values\": 8\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->dataReport([\n    'file' => 'document.pdf',\n    'sections' => '[\"summary\",\"charts\"]',\n    'columns' => '[\"region\",\"amount\"]',\n    'top_values' => 8,\n]);\necho $result->requestId;"}]}},"/v1/render/designs":{"post":{"operationId":"render.designs","summary":"Certificate / business card / flyer","description":"Make a certificate, a business card (front, back or both) or a flyer from your words in one of three looks (classic, modern, bold), as a PNG or a PDF at the real paper or card size, with your colours, font and an optional logo or picture.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"design":{"type":"string","enum":["certificate","business-card","flyer"],"example":"certificate","description":"What to make: certificate, business-card, flyer.","x-davix-h2i-enum":"RenderDesign","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"fields":{"type":"object","example":"{\"recipient\":\"Ada Lovelace\",\"title\":\"of Achievement\"}","description":"The texts. certificate: recipient (required), title, kicker, intro, text, date, signature_name, signature_title, signature2_name, signature2_title, seal_text. business-card: name (required), title, company, tagline, email, phone, website, address. flyer: headline (required), subheadline, body, bullets (a list), cta, date, location, price, contact, footer.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"image":{"type":"array","items":{"type":"string","format":"binary"},"description":"A logo or picture (PNG, JPEG or WebP): on a certificate and a card the logo, on a flyer the picture.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"template":{"type":"string","enum":["classic","modern","bold"],"default":"classic","description":"classic (default), modern or bold.","x-davix-h2i-enum":"RenderDesignsTemplate","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"paper":{"type":"string","example":"a4","description":"certificate: a4 (default), letter or a3. flyer: a4 (default), a5, a3 or letter. business-card: card-eu (85 x 55 mm, default) or card-us (3.5 x 2 in).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"orientation":{"type":"string","enum":["auto","landscape","portrait"],"default":"auto","description":"auto (default: landscape for a certificate and a card, portrait for a flyer), landscape or portrait.","x-davix-h2i-enum":"RenderDesignsOrientation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"side":{"type":"string","enum":["front","back","both"],"default":"front","description":"business-card: front (default), back or both (two pages in a PDF, stacked in a PNG).","x-davix-h2i-enum":"RenderSide","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"accent":{"type":"string","format":"color","example":"#2563eb","description":"The accent colour as a hex colour (default: from the palette). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"text_color":{"type":"string","format":"color","example":"#0f172a","description":"The text colour as a hex colour (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"align":{"type":"string","enum":["left","center","right"],"default":"center","description":"center (default), left or right.","x-davix-h2i-enum":"Align","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"border":{"type":"boolean","default":true,"description":"certificate: true (default) a frame.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"seal":{"type":"boolean","default":true,"description":"certificate: true (default) a seal.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"image_position":{"type":"string","enum":["top","left","right","background"],"default":"top","description":"flyer: top (default), left, right or background.","x-davix-h2i-enum":"RenderImagePosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"direction":{"type":"string","enum":["ltr","rtl"],"default":"ltr","description":"ltr (default) or rtl.","x-davix-h2i-enum":"Direction2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/designs.js"}},"output":{"type":"string","enum":["png","pdf"],"default":"png","description":"png (default) or pdf.","x-davix-h2i-enum":"RenderOutput4","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","warm","mono"],"default":"light","description":"The colours: light, dark, warm, mono (default light).","x-davix-h2i-enum":"RenderTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"palette":{"type":"string","enum":["default","pastel","vivid","mono","ocean","sunset"],"default":"default","description":"The colours of the data: default, pastel, vivid, mono, ocean, sunset (default default).","x-davix-h2i-enum":"RenderPalette","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"font":{"type":"string","enum":["sans","serif","mono","rounded","hand"],"default":"sans","description":"The font: sans, serif, mono, rounded, hand (default sans; the classic look uses serif).","x-davix-h2i-enum":"RenderFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"background":{"type":"string","format":"color","example":"#fffaf0","description":"The page colour as a hex colour (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"image\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["design","fields"]},"encoding":{"fields":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, design, template, paper, pages, sizeMm }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","description":"The width of the picture or page in pixels."},"height":{"type":"integer","description":"The height of the picture or page in pixels."},"design":{"type":"string","enum":["certificate","business-card","flyer"]},"template":{"type":"string"},"paper":{"type":"string"},"pages":{"type":"integer"},"sizeMm":{"type":"array","items":{"type":"number"},"description":"The paper or card size in millimetres: width, height."}},"required":["url","format","sizeBytes","design","template","paper","pages","sizeMm"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"image","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.designs","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/designs\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'design=certificate' \\\n  -F 'fields={\"recipient\":\"Ada Lovelace\",\"title\":\"of Achievement\"}' \\\n  -F 'template=classic'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.designs({\n    \"design\": \"certificate\",\n    \"fields\": \"{\\\"recipient\\\":\\\"Ada Lovelace\\\",\\\"title\\\":\\\"of Achievement\\\"}\",\n    \"template\": \"classic\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->designs([\n    'design' => 'certificate',\n    'fields' => '{\"recipient\":\"Ada Lovelace\",\"title\":\"of Achievement\"}',\n    'template' => 'classic',\n]);\necho $result->requestId;"}]}},"/v1/render/diagram":{"post":{"operationId":"render.diagram","summary":"Diagram to image","description":"Draw a diagram from a short text description: flowcharts, sequence diagrams, class and state diagrams, entity-relationship diagrams, Gantt charts, pie charts, mind maps and timelines (Mermaid), or Graphviz graphs (DOT). Returns a PNG, JPEG, WebP, AVIF or SVG picture.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"source":{"type":"string","maxLength":50000,"example":"graph TD\n  A[Start] --> B{Ready?}\n  B -->|Yes| C[Ship]","description":"The diagram written as text. Mermaid, for example \"graph TD; A-->B; B-->C\", or Graphviz DOT, for example \"digraph { a -> b }\".","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Missing -> 400 missing_field. A mistake in the text -> 400 invalid_parameter that carries the parser message.","evidence":"src/processing/render/diagram.js"}},"syntax":{"type":"string","enum":["auto","mermaid","dot"],"default":"auto","description":"Which notation the source uses: mermaid or dot. Default auto: Graphviz-style text (digraph or graph with a name, then braces) is read as DOT, anything else as Mermaid.","x-davix-h2i-enum":"RenderSyntax","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/diagram.js"}},"output":{"type":"string","enum":["svg","png","jpeg","webp","avif"],"default":"png","description":"png (default), svg (a vector drawing you can scale and edit), jpeg, webp or avif.","x-davix-h2i-enum":"DiagramOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["default","neutral","dark","forest","base"],"default":"default","description":"Mermaid colour theme: default, neutral, dark, forest or base. Not used for DOT.","x-davix-h2i-enum":"RenderDiagramTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/diagram.js"}},"engine":{"type":"string","enum":["dot","neato","fdp","circo","twopi","osage"],"default":"dot","description":"DOT layout: dot (layers, default), neato or fdp (springs), circo (circles), twopi (rings) or osage (clusters). Not used for Mermaid.","x-davix-h2i-enum":"RenderEngine","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/diagram.js"}},"background":{"type":"string","format":"color","example":"#ffffff","description":"Background colour: #rgb, #rrggbb, #rrggbbaa or transparent (not with jpeg). Default #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Background colour. Anything that is not #rgb, #rrggbb, #rrggbbaa or transparent -> 400.","evidence":"src/processing/render/picture-params.js"}},"padding":{"type":"integer","minimum":0,"maximum":400,"default":24,"description":"Space around the diagram in pixels, 0 to 400 (default 24).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/diagram.js"}},"width":{"type":"integer","minimum":100,"maximum":6000,"description":"Draw the diagram this many pixels wide (100 to 6000); its height follows. Default: its natural size.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/diagram.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"jpeg / webp / avif quality, 1-100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["source"]}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, syntax }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"syntax":{"type":"string","description":"mermaid or dot: the notation that was drawn."}},"required":["url","format","sizeBytes","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.diagram","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/diagram\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'source=graph TD\n  A[Start] --> B{Ready?}\n  B -->|Yes| C[Ship]' \\\n  -F 'syntax=auto' \\\n  -F 'output=png'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.diagram({\n    \"source\": \"graph TD\\n  A[Start] --> B{Ready?}\\n  B -->|Yes| C[Ship]\",\n    \"syntax\": \"auto\",\n    \"output\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->diagram([\n    'source' => 'graph TD\n  A[Start] --> B{Ready?}\n  B -->|Yes| C[Ship]',\n    'syntax' => 'auto',\n    'output' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/render/handwriting":{"post":{"operationId":"render.handwriting","summary":"Text to handwriting","description":"Write a text on lined, squared, dotted or blank paper in a handwriting-like way: every letter sits a little off the line, a little turned and a little different in size, in the ink and pen you choose. The same seed gives the same page.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"A text file with the text (instead of the text field).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"text":{"type":"string","example":"Dear Ada, thank you for the evening.","description":"The text (up to 60,000 characters). Send this or a file.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/handwriting.js"}},"paper":{"type":"string","enum":["lined","squared","dotted","blank","legal"],"default":"lined","description":"lined (default), squared, dotted, blank or legal.","x-davix-h2i-enum":"RenderHandwritingPaper","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"ink":{"type":"string","format":"color","default":"blue","example":"#1d3a8a","description":"The ink: blue, black, royal, red, green, pencil or a hex colour (default blue). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"pen":{"type":"string","enum":["fine","medium","thick"],"default":"medium","description":"fine, medium (default) or thick.","x-davix-h2i-enum":"RenderPen","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"font_size":{"type":"number","minimum":12,"maximum":60,"default":26,"description":"The size of the writing in pixels, 12 to 60 (default 26).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"line_height":{"type":"number","minimum":1,"maximum":3,"default":1.5,"description":"The line spacing as a multiple of the size, 1 to 3 (default 1.5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"messiness":{"type":"number","minimum":0,"maximum":1,"default":0.5,"description":"How uneven the writing is, 0 (neat) to 1 (default 0.5).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"slant":{"type":"number","minimum":-30,"maximum":30,"default":8,"description":"How much the writing leans, -30 to 30 degrees (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"default":7,"description":"The same seed gives the same page, 0 to 2147483647 (default 7).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"margin":{"type":"number","minimum":0,"maximum":200,"default":70,"description":"The margin in pixels, 0 to 200 (default 70).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"margin_line":{"type":"boolean","default":true,"description":"true (default): a red margin line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"paper_color":{"type":"string","format":"color","default":"#fdfcf6","example":"#fffbe6","description":"The paper as a hex colour (default #fdfcf6). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"line_color":{"type":"string","format":"color","default":"#b9c6e6","example":"#9db2e0","description":"The colour of the ruled lines as a hex colour (default #b9c6e6). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"shrink_to_fit":{"type":"boolean","default":true,"description":"true (default): make the writing smaller until the text fits the page (down to 12 pixels).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"word_spacing":{"type":"number","minimum":0,"maximum":3,"default":1,"description":"The space between words as a multiple, 0 to 3 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"paragraph_indent":{"type":"number","minimum":0,"maximum":200,"default":0,"description":"Indent the first line of a paragraph by this many pixels, 0 to 200 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/handwriting.js"}},"output":{"type":"string","enum":["png","pdf","svg"],"default":"png","description":"png (a picture), pdf, svg (scalable). Default png.","x-davix-h2i-enum":"RenderOutput3","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"width":{"type":"integer","minimum":200,"maximum":4000,"default":794,"description":"The width in pixels, 200 to 4000 (default 794).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"height":{"type":"integer","minimum":100,"maximum":8000,"default":1123,"description":"The height in pixels, 100 to 8000 (default 1123).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","warm","mono"],"default":"light","description":"The colours: light, dark, warm, mono (default light).","x-davix-h2i-enum":"RenderTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"palette":{"type":"string","enum":["default","pastel","vivid","mono","ocean","sunset"],"default":"default","description":"The colours of the data: default, pastel, vivid, mono, ocean, sunset (default default).","x-davix-h2i-enum":"RenderPalette","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"font":{"type":"string","enum":["sans","serif","mono","rounded","hand"],"default":"sans","description":"The font: sans, serif, mono, rounded, hand (default sans).","x-davix-h2i-enum":"RenderFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"background":{"type":"string","format":"color","example":"#fffaf0","description":"The background as a hex colour, or transparent (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"title":{"type":"string","example":"Q4 plan","description":"A title (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"subtitle":{"type":"string","example":"January to June","description":"A line under the title (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, lines, truncated, fontSize, characters, ink }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","description":"The width of the picture or page in pixels."},"height":{"type":"integer","description":"The height of the picture or page in pixels."},"lines":{"type":"integer"},"truncated":{"type":"integer","description":"Lines that did not fit the page and were left out."},"fontSize":{"type":"number","description":"The size of the writing that was used."},"characters":{"type":"integer"},"ink":{"type":"string","description":"The ink name, or custom for a hex colour."}},"required":["url","format","sizeBytes","lines","truncated","fontSize","characters","ink"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.handwriting","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/handwriting\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text=Dear Ada, thank you for the evening.' \\\n  -F 'paper=lined' \\\n  -F 'ink=#1d3a8a'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.handwriting({\n    \"text\": \"Dear Ada, thank you for the evening.\",\n    \"paper\": \"lined\",\n    \"ink\": \"#1d3a8a\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->handwriting([\n    'text' => 'Dear Ada, thank you for the evening.',\n    'paper' => 'lined',\n    'ink' => '#1d3a8a',\n]);\necho $result->requestId;"}]}},"/v1/render/html-to-image":{"post":{"operationId":"render.html-to-image","summary":"Render HTML to a PNG/JPEG screenshot","description":"Render HTML to a PNG/JPEG screenshot","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string","description":"The HTML to render. Send `html`, `url` or a saved template (templateId).","x-davix-h2i-behavior":{"onMissing":"reject","evidence":"src/api/render/shared.js"},"x-davix-h2i-conflicts-with":["templateId"]},"css":{"type":"string","description":"CSS appended to the document (after the saved template's own css when a templateId is used). {{variables}} in it are filled like those in the html.","x-davix-h2i-behavior":{"onInvalid":"passthrough","note":"Any string. Inserted verbatim inside a <style> element of the rendered page; Davix H2I does not parse or sanitise it (it only affects the rendered page). Empty = not applied.","evidence":"src/processing/render/engine.js:renderHtmlToImage"}},"width":{"type":"integer","minimum":1,"default":1000,"description":"Viewport width (px).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"parseInt() || 1000, clamped to [1, plan maximum]. Also bounded by the plan pixel budget (deviceScaleFactor^2 * width * height) -> 400 render_size_exceeded.","evidence":"src/api/render/shared.js"}},"height":{"type":"integer","minimum":1,"default":1500,"description":"Viewport height (px).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"parseInt() || 1500, clamped to [1, plan maximum].","evidence":"src/api/render/shared.js"}},"format":{"type":"string","enum":["png","jpeg","webp","avif"],"default":"png","description":"Image format (png, jpeg, webp, avif).","x-davix-h2i-enum":"RenderHtmlToImageFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"deviceScaleFactor":{"type":"number","minimum":1,"maximum":3,"default":1,"description":"Device pixel ratio.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1,3] -> 400.","evidence":"src/processing/render/engine.js:resolveDeviceScaleFactor"}},"clip":{"type":"object","properties":{"x":{"type":"number","minimum":0},"y":{"type":"number","minimum":0},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0}},"required":["x","y","width","height"],"description":"Crop region within the rendered viewport.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Must fit inside width x height -> 400.","evidence":"src/processing/render/engine.js"}},"waitForSelector":{"type":"string","description":"Wait until this CSS selector appears (at most 10 s).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Empty selector or one that does not appear within 10000 ms -> 400.","evidence":"src/processing/render/engine.js"}},"waitForMilliseconds":{"type":"integer","minimum":0,"maximum":10000,"description":"Extra wait before capture (ms).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [0,10000] -> 400.","evidence":"src/processing/render/engine.js"}},"waitUntil":{"type":"string","enum":["load","domcontentloaded","networkidle0","networkidle2"],"description":"Navigation milestone to wait for.","x-davix-h2i-enum":"RenderWaitUntil","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"mediaType":{"type":"string","enum":["screen","print"],"description":"CSS media type.","x-davix-h2i-enum":"RenderMediaType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"colorScheme":{"type":"string","enum":["light","dark","no-preference"],"description":"prefers-color-scheme.","x-davix-h2i-enum":"RenderColorScheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"timezone":{"type":"string","description":"IANA timezone, e.g. America/New_York.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"locale":{"type":"string","description":"BCP-47 locale, e.g. en-US.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"headers":{"type":"object","properties":{},"additionalProperties":true,"description":"Extra request headers per host: { \"host[:port]\": { \"Header\": \"value\" } } (max 10 hosts, 20 headers per host, names up to 200, values up to 4000 chars; Host cannot be overridden). Applied only to requests to that host.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"cookies":{"type":"array","maxItems":20,"items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"},"domain":{"type":"string","description":"Required unless url is given."},"url":{"type":"string","format":"uri","description":"Required unless domain is given."},"sameSite":{"type":"string","enum":["Strict","Lax","None"],"x-davix-h2i-enum":"RenderSameSite"},"path":{"type":"string"},"secure":{"type":"boolean"},"httpOnly":{"type":"boolean"}},"required":["name","value"]},"description":"Cookies (max 20). A cookie needs domain or url; domains that are localhost/private or fail DNS resolution are rejected.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"jpegQuality":{"type":"integer","minimum":1,"maximum":100,"description":"Quality 1-100 for jpeg, webp and avif.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1,100] -> 400.","evidence":"src/processing/render/engine.js"},"x-davix-h2i-depends-on":[{"field":"format","equals":"jpeg"}]},"url":{"type":"string","format":"uri","maxLength":2048,"description":"Render this public web page instead of `html` (send one of the two). Only http/https on ports 80 and 443; private, internal and cloud-metadata addresses are refused (400 url_blocked), every redirect and every resource the page loads goes through the same check. Can be switched off per plan or server-wide.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"The page is loaded in a sandboxed browser; its network access is limited to public addresses. 400 url_blocked / url_fetch_failed.","evidence":"src/processing/render/engine.js"}},"device":{"type":"string","enum":["iphone-se","iphone-14","iphone-14-pro-max","pixel-7","galaxy-s20","ipad","ipad-pro","android-tablet","laptop","desktop","desktop-4k"],"description":"Device preset: sets the viewport, pixel ratio, user agent and touch emulation. Explicit width / height / deviceScaleFactor / userAgent win over the preset.","x-davix-h2i-enum":"RenderDevice","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"userAgent":{"type":"string","maxLength":300,"description":"User-Agent header the page is loaded with (single line, max 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"blockResources":{"type":"array","items":{"type":"string","enum":["image","stylesheet","script","font","media","xhr","fetch","websocket","other"],"x-davix-h2i-enum":"RenderType"},"description":"Resource types the page may not load: image, stylesheet, script, font, media, xhr, fetch, websocket, other. The main document is never blocked.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"waitForFunction":{"type":"string","maxLength":1000,"description":"JavaScript expression evaluated in the page until it is truthy (at most 10 s), e.g. `window.chartReady === true`. Runs with the same rights as the page own scripts.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Never true within 10000 ms -> 400.","evidence":"src/processing/render/engine.js"}},"lang":{"type":"string","maxLength":40,"description":"Document language (BCP-47, e.g. ja, zh-Hans, ar). Sets <html lang> and the Accept-Language header so the right font variant and shaping are used for CJK, Arabic and Indic text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string"},"data":{"type":"string","description":"Base64 font file."},"weight":{"type":"integer","minimum":100,"maximum":900},"style":{"type":"string","enum":["normal","italic","oblique"],"x-davix-h2i-enum":"RenderStyle"}},"required":["family","data"]},"description":"Web fonts to use in the page: [{ family, data (base64 TTF/OTF/WOFF/WOFF2), weight, style }] (max 8, 3 MB each). They are embedded as data: URIs; fonts can never be loaded by a remote address.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"variables":{"type":"object","properties":{},"additionalProperties":true,"description":"Values for {{name}} / {{a.b}} placeholders in the html, the css or the saved template (one document). Values are HTML-escaped in the page; a value used as a whole link (src, href, CSS url()) must be an http(s) address or an image data: URI; a value used inside css cannot contain braces, semicolons, quotes, angle brackets, backslashes or comments. There is no expression language, so a value can never become markup or script. Max 200 values, strings up to 20,000 characters.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown placeholders become empty (a required variable of a saved template is a 400). 400 for a bad name, a value that is an array, or a value not allowed where it is used.","evidence":"src/processing/render/variables.js"}},"templateId":{"type":"string","format":"uuid","description":"Render a saved template instead of sending html (create one with POST /v1/templates). The template supplies the html and css; fill its {{variables}} with `variables` (one document) or `records` (one document per record). Send templateId or html, not both; it cannot be combined with markdown, text or url. Requires an individual customer API key.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown, someone else's or wrong-kind template -> 400 invalid_parameter. A required variable of the template that has no value -> 400 invalid_parameter naming it.","evidence":"src/processing/templates/service.js"},"x-davix-h2i-conflicts-with":["html","markdown","text","url"]},"records":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true},"description":"One object of variable values per document: the answer has one result per record (a image each) instead of one url. Send records or variables, not both; it cannot be combined with url. How many records one request may carry, and how they count toward the quota, is set per plan.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Empty, not an array, an element that is not an object, or more than the plan allows -> 400.","evidence":"src/api/render/shared.js"}},"transparent":{"type":"boolean","default":false,"description":"Keep the page background transparent (png, webp, avif).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"jpeg + transparent -> 400.","evidence":"src/processing/render/engine.js"}},"fullPage":{"type":"boolean","default":false,"description":"Capture the whole scrollable page instead of the viewport/body. Bounded by the plan pixel budget (400 render_size_exceeded). Cannot be combined with clip or selector.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"selector":{"type":"string","maxLength":300,"description":"Capture only the element matching this CSS selector (400 when nothing matches). Cannot be combined with clip or fullPage.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"scrollTo":{"type":"string","maxLength":300,"description":"Scroll before the capture: \"top\", \"bottom\" (steps down so lazy-loaded content loads), a pixel offset, or a CSS selector to bring into view.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}}}}},"responses":{"200":{"description":"One document: { url, file_id, ... }. With records: { results: [{ url, format, sizeBytes, record, ... }] }, one result per record.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","nullable":true,"description":"The result file (one document). With records the answer is `results` instead."},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"record":{"type":"integer"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only)."}},"required":["url","format","sizeBytes","record"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.html-to-image","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_url_ingestion","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","records_per_request","records_per_unit"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/html-to-image\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"width\":1000,\"height\":1500,\"format\":\"png\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.htmlToImage({\n    \"width\": 1000,\n    \"height\": 1500,\n    \"format\": \"png\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->htmlToImage([\n    'width' => 1000,\n    'height' => 1500,\n    'format' => 'png',\n]);\necho $result->requestId;"}]}},"/v1/render/html-to-pdf":{"post":{"operationId":"render.html-to-pdf","summary":"Render HTML to a PDF","description":"Render HTML to a PDF","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string","description":"The HTML to render. Provide exactly one of html, markdown, text or templateId. Send `html`, `url` or a saved template.","x-davix-h2i-behavior":{"onMissing":"reject","note":"One of html/markdown/text is required; more than one -> 400.","evidence":"src/api/render/shared.js"},"x-davix-h2i-conflicts-with":["markdown","text","templateId"]},"markdown":{"type":"string","maxLength":500000,"description":"Markdown source, converted to HTML (raw HTML in the markdown is not rendered).","x-davix-h2i-behavior":{"onOutOfRange":"reject","note":"Longer than 500,000 characters -> 413 html_too_large.","evidence":"src/api/render/shared.js"},"x-davix-h2i-conflicts-with":["html","text"]},"text":{"type":"string","maxLength":500000,"description":"Plain text, rendered as preformatted text.","x-davix-h2i-behavior":{"onOutOfRange":"reject","note":"Longer than 500,000 characters -> 413 html_too_large.","evidence":"src/api/render/shared.js"},"x-davix-h2i-conflicts-with":["html","markdown"]},"css":{"type":"string","description":"CSS appended to the document (after the saved template's own css when a templateId is used). {{variables}} in it are filled like those in the html.","x-davix-h2i-behavior":{"onInvalid":"passthrough","note":"Any string. Inserted verbatim inside a <style> element of the rendered page; Davix H2I does not parse or sanitise it (it only affects the rendered page). Empty = not applied.","evidence":"src/processing/render/engine.js:renderHtmlToImage"}},"width":{"type":"integer","minimum":1,"default":1000,"description":"Viewport width (px).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"parseInt() || 1000, clamped to [1, plan maximum]. Also bounded by the plan pixel budget (deviceScaleFactor^2 * width * height) -> 400 render_size_exceeded.","evidence":"src/api/render/shared.js"}},"height":{"type":"integer","minimum":1,"default":1500,"description":"Viewport height (px).","x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"parseInt() || 1500, clamped to [1, plan maximum].","evidence":"src/api/render/shared.js"}},"format":{"type":"string","enum":["A0","A1","A2","A3","A4","A5","A6","Letter","Legal","Tabloid","Ledger"],"default":"A4","description":"Paper format.","x-davix-h2i-enum":"RenderHtmlToPdfFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"landscape":{"type":"boolean","description":"Landscape orientation.","x-davix-h2i-behavior":{"onInvalid":"normalize","note":"Boolean true, or the string \"true\" (any case) = true. Any other string = false (NOT the default). A non-boolean, non-string value (e.g. a number) = the default (false).","evidence":"src/processing/render/engine.js:parseBoolean"}},"margin":{"type":"integer","default":24,"description":"Page margin (px).","x-davix-h2i-behavior":{"onInvalid":"fallback","note":"parseInt(); non-numeric -> 24. Not range-checked.","evidence":"src/processing/render/engine.js"}},"preferCSSPageSize":{"type":"boolean","description":"Use the CSS @page size instead of format.","x-davix-h2i-behavior":{"onInvalid":"normalize","note":"Boolean true, or the string \"true\" (any case) = true. Any other string = false (NOT the default true). A non-boolean, non-string value = the default (true).","evidence":"src/processing/render/engine.js:parseBoolean"}},"scale":{"type":"number","default":1,"description":"Page scale.","x-davix-h2i-behavior":{"onInvalid":"fallback","note":"parseFloat(); non-numeric -> 1. Not range-checked by Davix H2I (the renderer enforces its own range).","evidence":"src/processing/render/engine.js"}},"printMode":{"type":"boolean","description":"Use print media + print-friendly defaults.","x-davix-h2i-behavior":{"onInvalid":"normalize","note":"Boolean true, or the string \"true\" (any case) = true (renders with the print media type unless mediaType is given). Any other string = false. A non-boolean, non-string value = false.","evidence":"src/processing/render/engine.js:renderHtmlToPdf"}},"printBackground":{"type":"boolean","description":"Print background graphics.","x-davix-h2i-behavior":{"onInvalid":"normalize","note":"Boolean true, or the string \"true\" (any case) = true. Any other string = false (NOT the default true). A non-boolean, non-string value = the default (true).","evidence":"src/processing/render/engine.js:parseBoolean"}},"deviceScaleFactor":{"type":"number","minimum":1,"maximum":3,"default":1,"description":"Device pixel ratio.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [1,3] -> 400.","evidence":"src/processing/render/engine.js:resolveDeviceScaleFactor"}},"waitForSelector":{"type":"string","description":"Wait until this CSS selector appears (at most 10 s).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Empty selector or one that does not appear within 10000 ms -> 400.","evidence":"src/processing/render/engine.js"}},"waitForMilliseconds":{"type":"integer","minimum":0,"maximum":10000,"description":"Extra wait before capture (ms).","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","note":"Outside [0,10000] -> 400.","evidence":"src/processing/render/engine.js"}},"waitUntil":{"type":"string","enum":["load","domcontentloaded","networkidle0","networkidle2"],"description":"Navigation milestone to wait for.","x-davix-h2i-enum":"RenderWaitUntil","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"mediaType":{"type":"string","enum":["screen","print"],"description":"CSS media type.","x-davix-h2i-enum":"RenderMediaType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"colorScheme":{"type":"string","enum":["light","dark","no-preference"],"description":"prefers-color-scheme.","x-davix-h2i-enum":"RenderColorScheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"timezone":{"type":"string","description":"IANA timezone, e.g. America/New_York.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"locale":{"type":"string","description":"BCP-47 locale, e.g. en-US.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"headers":{"type":"object","properties":{},"additionalProperties":true,"description":"Extra request headers per host: { \"host[:port]\": { \"Header\": \"value\" } } (max 10 hosts, 20 headers per host, names up to 200, values up to 4000 chars; Host cannot be overridden). Applied only to requests to that host.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"cookies":{"type":"array","maxItems":20,"items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"},"domain":{"type":"string","description":"Required unless url is given."},"url":{"type":"string","format":"uri","description":"Required unless domain is given."},"sameSite":{"type":"string","enum":["Strict","Lax","None"],"x-davix-h2i-enum":"RenderSameSite"},"path":{"type":"string"},"secure":{"type":"boolean"},"httpOnly":{"type":"boolean"}},"required":["name","value"]},"description":"Cookies (max 20). A cookie needs domain or url; domains that are localhost/private or fail DNS resolution are rejected.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"headerTemplate":{"type":"string","maxLength":20000,"description":"Header HTML template.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"footerTemplate":{"type":"string","maxLength":20000,"description":"Footer HTML template.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"url":{"type":"string","format":"uri","maxLength":2048,"description":"Render this public web page instead of `html` (send one of the two). Only http/https on ports 80 and 443; private, internal and cloud-metadata addresses are refused (400 url_blocked), every redirect and every resource the page loads goes through the same check. Can be switched off per plan or server-wide.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"The page is loaded in a sandboxed browser; its network access is limited to public addresses. 400 url_blocked / url_fetch_failed.","evidence":"src/processing/render/engine.js"}},"device":{"type":"string","enum":["iphone-se","iphone-14","iphone-14-pro-max","pixel-7","galaxy-s20","ipad","ipad-pro","android-tablet","laptop","desktop","desktop-4k"],"description":"Device preset: sets the viewport, pixel ratio, user agent and touch emulation. Explicit width / height / deviceScaleFactor / userAgent win over the preset.","x-davix-h2i-enum":"RenderDevice","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"userAgent":{"type":"string","maxLength":300,"description":"User-Agent header the page is loaded with (single line, max 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"blockResources":{"type":"array","items":{"type":"string","enum":["image","stylesheet","script","font","media","xhr","fetch","websocket","other"],"x-davix-h2i-enum":"RenderType"},"description":"Resource types the page may not load: image, stylesheet, script, font, media, xhr, fetch, websocket, other. The main document is never blocked.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"waitForFunction":{"type":"string","maxLength":1000,"description":"JavaScript expression evaluated in the page until it is truthy (at most 10 s), e.g. `window.chartReady === true`. Runs with the same rights as the page own scripts.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Never true within 10000 ms -> 400.","evidence":"src/processing/render/engine.js"}},"lang":{"type":"string","maxLength":40,"description":"Document language (BCP-47, e.g. ja, zh-Hans, ar). Sets <html lang> and the Accept-Language header so the right font variant and shaping are used for CJK, Arabic and Indic text.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string"},"data":{"type":"string","description":"Base64 font file."},"weight":{"type":"integer","minimum":100,"maximum":900},"style":{"type":"string","enum":["normal","italic","oblique"],"x-davix-h2i-enum":"RenderStyle"}},"required":["family","data"]},"description":"Web fonts to use in the page: [{ family, data (base64 TTF/OTF/WOFF/WOFF2), weight, style }] (max 8, 3 MB each). They are embedded as data: URIs; fonts can never be loaded by a remote address.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"variables":{"type":"object","properties":{},"additionalProperties":true,"description":"Values for {{name}} / {{a.b}} placeholders in the html, the css or the saved template (one document). Values are HTML-escaped in the page; a value used as a whole link (src, href, CSS url()) must be an http(s) address or an image data: URI; a value used inside css cannot contain braces, semicolons, quotes, angle brackets, backslashes or comments. There is no expression language, so a value can never become markup or script. Max 200 values, strings up to 20,000 characters.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown placeholders become empty (a required variable of a saved template is a 400). 400 for a bad name, a value that is an array, or a value not allowed where it is used.","evidence":"src/processing/render/variables.js"}},"templateId":{"type":"string","format":"uuid","description":"Render a saved template instead of sending html (create one with POST /v1/templates). The template supplies the html and css; fill its {{variables}} with `variables` (one document) or `records` (one document per record). Send templateId or html, not both; it cannot be combined with markdown, text or url. Requires an individual customer API key.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Unknown, someone else's or wrong-kind template -> 400 invalid_parameter. A required variable of the template that has no value -> 400 invalid_parameter naming it.","evidence":"src/processing/templates/service.js"},"x-davix-h2i-conflicts-with":["html","markdown","text","url"]},"records":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true},"description":"One object of variable values per document: the answer has one result per record (a PDF each) instead of one url. Send records or variables, not both; it cannot be combined with url. How many records one request may carry, and how they count toward the quota, is set per plan.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Empty, not an array, an element that is not an object, or more than the plan allows -> 400.","evidence":"src/api/render/shared.js"}},"pageRanges":{"type":"string","maxLength":200,"description":"Pages to keep, e.g. \"1-3, 5, 8-10\".","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"outline":{"type":"boolean","default":false,"description":"Add bookmarks built from the document h1-h6 headings (the response reports how many bookmarks were written).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"tagged":{"type":"boolean","default":false,"description":"Produce a tagged (accessible) PDF.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"metadata":{"type":"object","properties":{"title":{"type":"string","maxLength":1000},"author":{"type":"string","maxLength":1000},"subject":{"type":"string","maxLength":1000},"keywords":{"type":"string","maxLength":1000},"creator":{"type":"string","maxLength":1000}},"description":"Document information: { title, author, subject, keywords (comma separated), creator }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"pdfa":{"type":"string","enum":["1b","2b","3b"],"description":"Convert the result to PDF/A (1b, 2b or 3b) and validate it; the response says which level passed. Fails rather than claiming conformance that did not validate.","x-davix-h2i-enum":"RenderPdfa","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/engine.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}}}}},"responses":{"200":{"description":"One document: { url, file_id, ... }. With records: { results: [{ url, format, sizeBytes, record, ... }] }, one result per record.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","nullable":true,"description":"The result file (one document). With records the answer is `results` instead."},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only): pass it to GET /v1/files/{id} to fetch the file again, or DELETE /v1/files/{id} to delete it now."},"bookmarks":{"type":"integer","nullable":true,"description":"Number of bookmarks written (only when outline was requested)."},"pdfa":{"type":"string","nullable":true,"description":"The PDF/A level that validated (only when pdfa was requested)."},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"record":{"type":"integer"},"bookmarks":{"type":"integer"},"pdfa":{"type":"string"},"file_id":{"type":"integer","nullable":true,"description":"The file's id in your file history (customer keys only)."}},"required":["url","format","sizeBytes","record"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.html-to-pdf","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_url_ingestion","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started","records_per_request","records_per_unit"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/html-to-pdf\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"width\":1000,\"height\":1500,\"format\":\"A4\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.htmlToPdf({\n    \"width\": 1000,\n    \"height\": 1500,\n    \"format\": \"A4\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->htmlToPdf([\n    'width' => 1000,\n    'height' => 1500,\n    'format' => 'A4',\n]);\necho $result->requestId;"}]}},"/v1/render/labels":{"post":{"operationId":"render.labels","summary":"Label sheet","description":"Print a list of records (addresses, product names, name badges) on sheets of sticky labels: Avery and other standard layouts or your own measurements, a text template with {{column}} placeholders, optional QR code or barcode, as a PDF (one page per sheet) or one PNG per sheet.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"string","maxLength":500000,"example":"Country,Orders\nGermany,12\nFrance,8","description":"The records to print: a CSV or TSV with a header row, a JSON list of objects, or one label per line. Send the data, or a data_file.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Neither data nor data_file -> 400 missing_field; both -> 400. More than 40 columns -> 400.","evidence":"src/processing/render/table-image.js"}},"data_file":{"type":"array","items":{"type":"string","format":"binary"},"description":"A CSV, TSV, XLSX, ODS or JSON file with the records (first sheet; the first row is the column names), instead of data. Send the file, or its web address in data_file_url.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Send either data or data_file, not both. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"template":{"type":"string","example":"{{name}}\n{{street}}\n{{postcode}} {{city}}","description":"What each label says: text with {{column}} placeholders, one line per line. Default: every column on its own line.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"layout":{"type":"string","enum":["avery-5160","avery-5161","avery-5163","avery-5167","avery-5262","avery-5160-name","avery-l7160","avery-l7161","avery-l7163","avery-l7651","avery-l7165","a4-2x7","a4-3x8","a4-4x10","custom"],"default":"avery-l7160","description":"The label sheet: avery-5160, avery-5161, avery-5163, avery-5167, avery-5262, avery-5160-name, avery-l7160, avery-l7161, avery-l7163, avery-l7651, avery-l7165, a4-2x7, a4-3x8, a4-4x10, or custom (then columns, rows, label_width_mm and label_height_mm are required). Default avery-l7160.","x-davix-h2i-enum":"RenderLayout","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"paper":{"type":"string","enum":["a4","letter","legal","a5"],"description":"The sheet size: a4, letter, legal or a5 (default: the layout's own).","x-davix-h2i-enum":"RenderLabelsPaper","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"landscape":{"type":"boolean","default":false,"description":"true: turn the sheet on its side. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"columns":{"type":"integer","minimum":1,"maximum":20,"description":"Labels across the sheet (overrides the layout), 1 to 20.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"rows":{"type":"integer","minimum":1,"maximum":50,"description":"Labels down the sheet (overrides the layout), 1 to 50.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"label_width_mm":{"type":"number","minimum":5,"maximum":400,"description":"The width of one label in millimetres (overrides the layout).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"label_height_mm":{"type":"number","minimum":5,"maximum":400,"description":"The height of one label in millimetres (overrides the layout).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"margin_top_mm":{"type":"number","minimum":0,"maximum":200,"description":"The space above the first row in millimetres (default: the layout's own, else 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"margin_left_mm":{"type":"number","minimum":0,"maximum":200,"description":"The space left of the first column in millimetres (default: the layout's own, else 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"gap_x_mm":{"type":"number","minimum":0,"maximum":100,"description":"The gap between columns in millimetres.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"gap_y_mm":{"type":"number","minimum":0,"maximum":100,"description":"The gap between rows in millimetres.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"skip":{"type":"integer","minimum":0,"maximum":999,"default":0,"description":"Leave this many labels empty at the start of the first sheet, to reuse a sheet that is partly used (counted row by row).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"copies":{"type":"integer","minimum":1,"maximum":500,"default":1,"description":"Print every record this many times, 1 to 500 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"max_labels":{"type":"integer","minimum":1,"maximum":5000,"default":2000,"description":"The most labels to print, 1 to 5000 (default 2000); more -> 400.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"font":{"type":"string","enum":["sans","serif","mono"],"default":"sans","description":"sans (default), serif or mono.","x-davix-h2i-enum":"Font","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"font_size":{"type":"number","minimum":4,"maximum":72,"default":10,"description":"The text size in points, 4 to 72 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"auto_fit":{"type":"boolean","default":true,"description":"true (default): make the text smaller, down to 4 pt, when it does not fit its label.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"bold_first_line":{"type":"boolean","default":false,"description":"true: print the first line of every label in bold (for example the name). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"line_height":{"type":"number","minimum":0.9,"maximum":2.5,"default":1.2,"description":"The line spacing, 0.9 to 2.5 (default 1.2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"align":{"type":"string","enum":["left","center","right"],"default":"left","description":"left (default), center or right.","x-davix-h2i-enum":"Align","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"valign":{"type":"string","enum":["top","middle","bottom"],"default":"middle","description":"top, middle (default) or bottom.","x-davix-h2i-enum":"RenderValign","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"padding_mm":{"type":"number","minimum":0,"maximum":30,"default":2,"description":"The space inside each label in millimetres, 0 to 30 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"direction":{"type":"string","enum":["ltr","rtl"],"default":"ltr","description":"ltr (default) or rtl for Arabic, Hebrew, Persian and Urdu.","x-davix-h2i-enum":"Direction2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"color":{"type":"string","format":"color","default":"#000000","description":"The text colour as a hex colour (default #000000). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"background":{"type":"string","format":"color","example":"#fff3cd","description":"A fill colour for every label as a hex colour (default none; leave it empty for real sticky sheets). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"border":{"type":"boolean","default":false,"description":"true: draw a dashed outline around every label, to check the alignment on plain paper. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"radius_mm":{"type":"number","minimum":0,"maximum":30,"default":0,"description":"Round the corners of the outline and fill, 0 to 30 mm.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"qr_field":{"type":"string","example":"url","description":"The column whose value is printed as a QR code on each label (not together with barcode_field).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"barcode_field":{"type":"string","example":"sku","description":"The column whose value is printed as a barcode on each label (not together with qr_field).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"barcode_type":{"type":"string","enum":["code128","code39","ean13","ean8","upca","itf14","datamatrix","pdf417"],"default":"code128","description":"The kind of barcode: code128 (default), code39, ean13, ean8, upca, itf14, datamatrix or pdf417.","x-davix-h2i-enum":"RenderBarcodeType","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"code_size_mm":{"type":"number","minimum":6,"maximum":100,"description":"The size of the QR code or barcode in millimetres (default: as large as fits).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"code_position":{"type":"string","enum":["right","left","bottom","top"],"default":"right","description":"Where the code sits on the label: right (default), left, bottom or top.","x-davix-h2i-enum":"RenderCodePosition","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"barcode_text":{"type":"boolean","default":true,"description":"true (default): print the value under a linear barcode.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"sheet_title":{"type":"string","example":"Mailing 14 Nov","description":"A small text at the bottom of every sheet (outside the labels), for example a job name.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"page_numbers":{"type":"boolean","default":false,"description":"true: add \"1/3\" style sheet numbers at the bottom. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"output":{"type":"string","enum":["pdf","png"],"default":"pdf","description":"pdf (default: one file, a page per sheet) or png (one picture per sheet, at most 20 sheets).","x-davix-h2i-enum":"RenderOutput2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/labels.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"data_file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, labels, sheets, labelsPerSheet, layout, paper, columns, sheet? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["pdf","png"]},"sizeBytes":{"type":"integer"},"labels":{"type":"integer","description":"How many labels were printed (records x copies)."},"sheets":{"type":"integer","description":"How many sheets (pages) they fill."},"labelsPerSheet":{"type":"integer"},"layout":{"type":"string"},"paper":{"type":"string"},"columns":{"type":"integer","description":"How many columns the records have."},"sheet":{"type":"integer","description":"With output=png: the sheet this picture shows."}},"required":["url","format","sizeBytes","labels","sheets","labelsPerSheet","layout","paper","columns"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"data_file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.labels","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/labels\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'data=Country,Orders\nGermany,12\nFrance,8' \\\n  -F 'template={{name}}\n{{street}}\n{{postcode}} {{city}}' \\\n  -F 'layout=avery-l7160'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.labels({\n    \"data\": \"Country,Orders\\nGermany,12\\nFrance,8\",\n    \"template\": \"{{name}}\\n{{street}}\\n{{postcode}} {{city}}\",\n    \"layout\": \"avery-l7160\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->labels([\n    'data' => 'Country,Orders\nGermany,12\nFrance,8',\n    'template' => '{{name}}\n{{street}}\n{{postcode}} {{city}}',\n    'layout' => 'avery-l7160',\n]);\necho $result->requestId;"}]}},"/v1/render/map":{"post":{"operationId":"render.map","summary":"Map chart","description":"Draw places (latitude and longitude) as dots or bubbles on a simple world map: sized by a value, coloured by group or value, with labels, a connecting line, a graticule and a legend, in three projections, for the whole world or zoomed to the places.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"points":{"type":"array","example":"[{\"lat\":52.52,\"lon\":13.4,\"label\":\"Berlin\",\"value\":3.7}]","items":{"type":"object","properties":{"lat":{"type":"number"},"lon":{"type":"number"},"label":{"type":"string"},"value":{"type":"number"},"color":{"type":"string","format":"color","description":"Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"group":{"type":"string"}},"required":["lat","lon"]},"description":"The places: a list of { lat, lon, label?, value?, color?, group? }.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"projection":{"type":"string","enum":["equirectangular","mercator","equal-earth"],"default":"equirectangular","description":"equirectangular (default), mercator or equal-earth.","x-davix-h2i-enum":"RenderMapProjection","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"view":{"type":"string","enum":["world","fit"],"default":"world","description":"world (default) or fit (zoom to the places).","x-davix-h2i-enum":"RenderMapView","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"bounds":{"type":"array","example":"[-10,35,30,60]","items":{"type":"string"},"description":"The area to show as west, south, east, north in degrees.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"land_color":{"type":"string","format":"color","example":"#d7dfe8","description":"The land as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"ocean_color":{"type":"string","format":"color","example":"#eef4fb","description":"The sea as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"graticule":{"type":"boolean","default":true,"description":"true (default): lines of latitude and longitude.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"labels":{"type":"boolean","default":false,"description":"true: write the label of each place. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"connect":{"type":"boolean","default":false,"description":"true: join the places in order with a dashed line. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"legend":{"type":"boolean","default":true,"description":"true (default): a legend for groups or values.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"radius":{"type":"number","minimum":1,"maximum":60,"default":6,"description":"The size of a dot in pixels, 1 to 60 (default 6).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"max_radius":{"type":"number","minimum":4,"maximum":120,"default":28,"description":"With size_by value: the biggest dot, 4 to 120 (default 28).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"size_by":{"type":"string","enum":["fixed","value"],"default":"value","description":"value (default: the dot grows with the value) or fixed.","x-davix-h2i-enum":"RenderSizeBy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"color_by":{"type":"string","enum":["single","group","value"],"default":"single","description":"single (default), group or value.","x-davix-h2i-enum":"RenderColorBy","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"opacity":{"type":"number","minimum":0.1,"maximum":1,"default":0.75,"description":"The opacity of the dots, 0.1 to 1 (default 0.75).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"dot_color":{"type":"string","format":"color","example":"#dc2626","description":"One colour for every dot as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"padding":{"type":"number","minimum":0,"maximum":60,"default":8,"description":"The space around the map in pixels, 0 to 60 (default 8).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/map-chart.js"}},"output":{"type":"string","enum":["png","pdf","svg"],"default":"png","description":"png (a picture), pdf, svg (scalable). Default png.","x-davix-h2i-enum":"RenderOutput3","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"width":{"type":"integer","minimum":200,"maximum":4000,"default":1200,"description":"The width in pixels, 200 to 4000 (default 1200).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"height":{"type":"integer","minimum":100,"maximum":8000,"default":650,"description":"The height in pixels, 100 to 8000 (default 650).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","warm","mono"],"default":"light","description":"The colours: light, dark, warm, mono (default light).","x-davix-h2i-enum":"RenderTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"palette":{"type":"string","enum":["default","pastel","vivid","mono","ocean","sunset"],"default":"default","description":"The colours of the data: default, pastel, vivid, mono, ocean, sunset (default default).","x-davix-h2i-enum":"RenderPalette","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"font":{"type":"string","enum":["sans","serif","mono","rounded","hand"],"default":"sans","description":"The font: sans, serif, mono, rounded, hand (default sans).","x-davix-h2i-enum":"RenderFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"background":{"type":"string","format":"color","example":"#fffaf0","description":"The background as a hex colour, or transparent (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"title":{"type":"string","example":"Q4 plan","description":"A title (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"subtitle":{"type":"string","example":"January to June","description":"A line under the title (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["points"]},"encoding":{"points":{"contentType":"application/json"},"bounds":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, points, projection, bounds }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","description":"The width of the picture or page in pixels."},"height":{"type":"integer","description":"The height of the picture or page in pixels."},"points":{"type":"integer"},"projection":{"type":"string"},"bounds":{"type":"array","items":{"type":"number"},"description":"The area that is shown: west, south, east, north."}},"required":["url","format","sizeBytes","points","projection","bounds"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.map","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/map\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'points=[{\"lat\":52.52,\"lon\":13.4,\"label\":\"Berlin\",\"value\":3.7}]' \\\n  -F 'projection=equirectangular' \\\n  -F 'view=world'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.map({\n    \"points\": \"[{\\\"lat\\\":52.52,\\\"lon\\\":13.4,\\\"label\\\":\\\"Berlin\\\",\\\"value\\\":3.7}]\",\n    \"projection\": \"equirectangular\",\n    \"view\": \"world\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->map([\n    'points' => '[{\"lat\":52.52,\"lon\":13.4,\"label\":\"Berlin\",\"value\":3.7}]',\n    'projection' => 'equirectangular',\n    'view' => 'world',\n]);\necho $result->requestId;"}]}},"/v1/render/math":{"post":{"operationId":"render.math","summary":"Math to image","description":"Turn a formula written in LaTeX into a sharp picture with a transparent or coloured background, for documents, slides and web pages.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"formula":{"type":"string","maxLength":10000,"example":"E = mc^2","description":"The formula in LaTeX, for example \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}. Dollar signs around it are allowed.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Missing -> 400 missing_field. A mistake in the formula -> 400 invalid_parameter that carries the parser message.","evidence":"src/processing/render/math-image.js"}},"output":{"type":"string","enum":["png","jpeg","webp","avif"],"default":"png","description":"png (default), jpeg, webp or avif.","x-davix-h2i-enum":"PictureOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"display":{"type":"string","enum":["block","inline"],"default":"block","description":"block (default): the formula as a displayed equation, larger and centred. inline: as it would look inside a sentence.","x-davix-h2i-enum":"RenderDisplay","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/math-image.js"}},"font_size":{"type":"number","minimum":8,"maximum":200,"default":32,"description":"Size of the formula in pixels, 8 to 200 (default 32).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/math-image.js"}},"color":{"type":"string","format":"color","example":"#1d4ed8","description":"Colour of the formula: #rgb, #rrggbb or #rrggbbaa. Default #111111. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"transparent or anything that is not a hex colour -> 400.","evidence":"src/processing/render/math-image.js"}},"background":{"type":"string","format":"color","example":"#ffffff","description":"Background colour: #rgb, #rrggbb, #rrggbbaa or transparent (not with jpeg). Default #ffffff. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Background colour. Anything that is not #rgb, #rrggbb, #rrggbbaa or transparent -> 400.","evidence":"src/processing/render/picture-params.js"}},"padding":{"type":"number","minimum":0,"maximum":400,"default":24,"description":"Space around the formula in pixels, 0 to 400 (default 24).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/math-image.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"jpeg / webp / avif quality, 1-100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["formula"]}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"}},"required":["url","format","sizeBytes","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.math","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/math\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'formula=E = mc^2' \\\n  -F 'output=png' \\\n  -F 'display=block'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.math({\n    \"formula\": \"E = mc^2\",\n    \"output\": \"png\",\n    \"display\": \"block\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->math([\n    'formula' => 'E = mc^2',\n    'output' => 'png',\n    'display' => 'block',\n]);\necho $result->requestId;"}]}},"/v1/render/model-3d":{"post":{"operationId":"render.model-3d","summary":"3D model preview","description":"Draw a picture of a 3D model (STL, OBJ or text PLY) from the side or angle you choose, shaded by a light, with edges, a ground shadow, axes and a turntable sheet, and get its size, surface area and volume.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"minItems":1,"description":"The model: an STL (binary or text), an OBJ or a text PLY file.","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"view":{"type":"string","enum":["isometric","front","back","left","right","top","bottom","perspective"],"default":"isometric","description":"The side: isometric, front, back, left, right, top, bottom, perspective (default isometric).","x-davix-h2i-enum":"RenderModel3dView","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"up":{"type":"string","enum":["z","y"],"default":"z","description":"Which axis is up in the file: z (default) or y.","x-davix-h2i-enum":"RenderUp","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"azimuth":{"type":"number","minimum":-360,"maximum":360,"description":"Turn the model around its vertical axis, -360 to 360 degrees (default: from view).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"elevation":{"type":"number","minimum":-90,"maximum":90,"description":"Tilt the camera, -90 to 90 degrees (default: from view).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"projection":{"type":"string","enum":["orthographic","perspective"],"default":"orthographic","description":"orthographic (default) or perspective.","x-davix-h2i-enum":"RenderModel3dProjection","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"color":{"type":"string","format":"color","example":"#2563eb","description":"The colour of the model as a hex colour (default: from the palette). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"edges":{"type":"boolean","default":false,"description":"true: draw the edges of the triangles. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"edge_color":{"type":"string","format":"color","example":"#111111","description":"The colour of the edges as a hex colour. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"wireframe":{"type":"boolean","default":false,"description":"true: only the edges, no surfaces. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"ground_shadow":{"type":"boolean","default":true,"description":"true (default): a soft shadow under the model.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"axes":{"type":"boolean","default":false,"description":"true: draw the X, Y and Z axes. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"grid":{"type":"boolean","default":false,"description":"true: a floor grid. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"light_azimuth":{"type":"number","minimum":-360,"maximum":360,"default":-40,"description":"Where the light comes from around the model, -360 to 360 degrees (default -40).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"light_elevation":{"type":"number","minimum":0,"maximum":90,"default":45,"description":"How high the light is, 0 to 90 degrees (default 45).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"ambient":{"type":"number","minimum":0,"maximum":1,"default":0.35,"description":"How much light reaches the shaded sides, 0 to 1 (default 0.35).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"padding":{"type":"number","minimum":0,"maximum":40,"default":10,"description":"The space around the model in pixels, 0 to 40 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"turntable":{"type":"integer","minimum":0,"maximum":12,"default":0,"description":"Show the model from this many angles on one sheet, 2 to 12 (0 = one view, default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"max_faces":{"type":"integer","minimum":1000,"maximum":80000,"default":40000,"description":"Draw at most this many triangles (more are left out evenly), 1000 to 80000 (default 40000).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"dimensions":{"type":"boolean","default":false,"description":"true: write the size under the picture. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"unit":{"type":"string","example":"mm","description":"The unit written after the size (up to 10 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/model-3d.js"}},"output":{"type":"string","enum":["png","pdf","svg"],"default":"png","description":"png (a picture), pdf, svg (scalable). Default png.","x-davix-h2i-enum":"RenderOutput3","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"width":{"type":"integer","minimum":200,"maximum":4000,"default":900,"description":"The width in pixels, 200 to 4000 (default 900).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"height":{"type":"integer","minimum":100,"maximum":8000,"default":700,"description":"The height in pixels, 100 to 8000 (default 700).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","warm","mono"],"default":"light","description":"The colours: light, dark, warm, mono (default light).","x-davix-h2i-enum":"RenderTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"palette":{"type":"string","enum":["default","pastel","vivid","mono","ocean","sunset"],"default":"default","description":"The colours of the data: default, pastel, vivid, mono, ocean, sunset (default default).","x-davix-h2i-enum":"RenderPalette","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"font":{"type":"string","enum":["sans","serif","mono","rounded","hand"],"default":"sans","description":"The font: sans, serif, mono, rounded, hand (default sans).","x-davix-h2i-enum":"RenderFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"background":{"type":"string","format":"color","example":"#fffaf0","description":"The background as a hex colour, or transparent (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"title":{"type":"string","example":"Q4 plan","description":"A title (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"subtitle":{"type":"string","example":"January to June","description":"A line under the title (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file"]},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, faces, drawn, decimated, size: [x, y, z], min, max, area, volume, views }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","description":"The width of the picture or page in pixels."},"height":{"type":"integer","description":"The height of the picture or page in pixels."},"faces":{"type":"integer"},"drawn":{"type":"integer"},"decimated":{"type":"integer","description":"Triangles left out because there were more than max_faces."},"size":{"type":"array","items":{"type":"number"},"description":"The width, depth and height of the model in its own units."},"min":{"type":"array","items":{"type":"number"}},"max":{"type":"array","items":{"type":"number"}},"area":{"type":"number","description":"The surface area in square model units."},"volume":{"type":"number","description":"The volume in cubic model units (for a closed model)."},"views":{"type":"integer"}},"required":["url","format","sizeBytes","faces","drawn","decimated","size","area","volume","views"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":1,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.model-3d","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/model-3d\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'view=isometric' \\\n  -F 'up=z' \\\n  -F 'azimuth=-360'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.model3d({\n    \"file\": 'document.pdf',\n    \"view\": \"isometric\",\n    \"up\": \"z\",\n    \"azimuth\": -360\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->model3d([\n    'file' => 'document.pdf',\n    'view' => 'isometric',\n    'up' => 'z',\n    'azimuth' => -360,\n]);\necho $result->requestId;"}]}},"/v1/render/resume":{"post":{"operationId":"render.resume","summary":"Resume builder","description":"Build a designed resume from data (name, contact, summary, experience, education, skills, projects, languages ...) in one of five templates, as a PDF or a tall PNG, with localized dates, renamed or translated section titles, a chosen section order, a photo and a one-page fit.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"resume":{"type":"object","example":"{\"name\":\"Ada Lovelace\",\"title\":\"Engineer\",\"experience\":[{\"role\":\"Lead\",\"company\":\"Acme\",\"start\":\"2020-03\",\"current\":true,\"bullets\":[\"Built a compiler\"]}]}","description":"The resume as JSON: { name, title, summary, contact: { email, phone, location, website, linkedin, github }, experience: [{ role, company, location, start, end, current, description, bullets }], education: [{ school, degree, field, start, end, details }], skills: [{ category, items } or text], projects: [{ name, link, description, bullets }], languages: [{ name, level }], certifications: [{ name, issuer, year }], awards: [text], interests: [text], custom: [{ title, items }] }. Dates are YYYY, YYYY-MM or \"present\". Only name is required.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"photo":{"type":"array","items":{"type":"string","format":"binary"},"description":"A photo of the person (PNG, JPEG or WebP), shown in the modern, compact and sidebar designs (the classic and minimal designs have no photo).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"],"note":"The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"template":{"type":"string","enum":["classic","modern","minimal","sidebar","compact"],"default":"modern","description":"The design: classic, modern, minimal, sidebar, compact (default modern).","x-davix-h2i-enum":"RenderResumeTemplate","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"accent":{"type":"string","format":"color","default":"#2563eb","example":"#e11d48","description":"The accent colour as a hex colour (default #2563eb). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"font":{"type":"string","enum":["sans","serif","mono"],"default":"sans","description":"sans (default), serif or mono.","x-davix-h2i-enum":"Font","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"font_size":{"type":"number","minimum":8,"maximum":14,"default":10,"description":"The base font size in points, 8 to 14 (default 10).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"paper":{"type":"string","enum":["a4","letter"],"default":"a4","description":"a4 (default) or letter.","x-davix-h2i-enum":"Paper","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"margin":{"type":"number","minimum":5,"maximum":40,"default":16,"description":"The page margin in millimetres, 5 to 40 (default 16).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"direction":{"type":"string","enum":["ltr","rtl"],"default":"ltr","description":"ltr (default) or rtl for Arabic, Hebrew, Persian and Urdu.","x-davix-h2i-enum":"Direction2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"locale":{"type":"string","default":"en-US","example":"de-DE","description":"The language of the dates, as a language tag such as en-US (default), de-DE or fr-FR. It also sets the page language.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"date_format":{"type":"string","enum":["short","long","year","numeric"],"default":"short","description":"short (Mar 2020, default), long (March 2020), year (2020) or numeric (03/2020).","x-davix-h2i-enum":"RenderDateFormat","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"sections":{"type":"array","example":"[\"summary\",\"experience\",\"education\",\"skills\"]","items":{"type":"string"},"description":"Which sections to print and in what order, as a list or comma-separated: summary, experience, education, skills, projects, languages, certifications, awards, interests, custom (default: all, in that order).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"section_titles":{"type":"object","example":"{\"experience\":\"Erfahrung\",\"education\":\"Ausbildung\"}","description":"Rename or translate the section titles: { \"experience\": \"Erfahrung\", \"present\": \"heute\" }. Keys: summary, experience, education, skills, projects, languages, certifications, awards, interests, contact, present.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"bullet_style":{"type":"string","enum":["disc","dash","arrow","none"],"default":"disc","description":"The bullet of lists: disc (default), dash, arrow or none.","x-davix-h2i-enum":"RenderBulletStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"links":{"type":"boolean","default":true,"description":"true (default): e-mail, web and project addresses are clickable.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"one_page":{"type":"boolean","default":false,"description":"true: make the text smaller until everything fits one page (down to 4.5 pt). Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"photo_shape":{"type":"string","enum":["circle","rounded","square"],"default":"circle","description":"The shape of the photo: circle (default), rounded or square.","x-davix-h2i-enum":"RenderPhotoShape","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"output":{"type":"string","enum":["pdf","png"],"default":"pdf","description":"pdf (default) or png (one tall picture of the page).","x-davix-h2i-enum":"RenderOutput2","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/resume.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"photo\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["resume"]},"encoding":{"resume":{"contentType":"application/json"},"sections":{"contentType":"application/json"},"section_titles":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, template, paper, sections, name, pages? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["pdf","png"]},"sizeBytes":{"type":"integer"},"template":{"type":"string"},"paper":{"type":"string"},"sections":{"type":"array","items":{"type":"string"},"description":"The sections that had content and were printed, in order."},"name":{"type":"string"},"pages":{"type":"integer","description":"With pdf: how many pages the resume fills."}},"required":["url","format","sizeBytes","template","paper","sections","name"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"photo","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.resume","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/resume\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'resume={\"name\":\"Ada Lovelace\",\"title\":\"Engineer\",\"experience\":[{\"role\":\"Lead\",\"company\":\"Acme\",\"start\":\"2020-03\",\"current\":true,\"bullets\":[\"Built a compiler\"]}]}' \\\n  -F 'template=modern' \\\n  -F 'accent=#e11d48'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.resume({\n    \"resume\": \"{\\\"name\\\":\\\"Ada Lovelace\\\",\\\"title\\\":\\\"Engineer\\\",\\\"experience\\\":[{\\\"role\\\":\\\"Lead\\\",\\\"company\\\":\\\"Acme\\\",\\\"start\\\":\\\"2020-03\\\",\\\"current\\\":true,\\\"bullets\\\":[\\\"Built a compiler\\\"]}]}\",\n    \"template\": \"modern\",\n    \"accent\": \"#e11d48\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->resume([\n    'resume' => '{\"name\":\"Ada Lovelace\",\"title\":\"Engineer\",\"experience\":[{\"role\":\"Lead\",\"company\":\"Acme\",\"start\":\"2020-03\",\"current\":true,\"bullets\":[\"Built a compiler\"]}]}',\n    'template' => 'modern',\n    'accent' => '#e11d48',\n]);\necho $result->requestId;"}]}},"/v1/render/site-capture":{"post":{"operationId":"render.site-capture","summary":"Capture a whole site","description":"Take a picture of every page of a site: from one start address, the pages reachable by links (same host, to a depth and a page limit), or an exact list of pages. Full-page or screen-size, in any device size, with cookie banners hidden, as separate pictures or one ZIP with a manifest.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"url":{"type":"string","example":"https://example.com/","description":"The start address, https://example.com/. Private and internal addresses are refused, also after a redirect.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"urls":{"type":"array","example":"[\"/pricing\",\"/about\"]","items":{"type":"string"},"description":"Capture exactly these pages instead of following links: full addresses or paths starting with / (on the same host as url). The start address is captured too.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"max_pages":{"type":"integer","minimum":1,"maximum":30,"default":5,"description":"The most pages to capture, 1 to 30 (default 5). Every captured page counts as one render.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"depth":{"type":"integer","minimum":0,"maximum":4,"default":1,"description":"How many clicks away from the start address to follow links, 0 to 4 (default 1; 0 = only the start page).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"scope":{"type":"string","enum":["host","domain","path"],"default":"host","description":"Which links to follow: host (default, the same host), domain (also its subdomains) or path (only below the start address' folder).","x-davix-h2i-enum":"RenderScope","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"include":{"type":"array","example":"[\"/blog/\"]","items":{"type":"string"},"description":"Follow only links whose address matches one of these patterns (regular expressions, for example /blog/).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"exclude":{"type":"array","example":"[\"logout\",\"/cart\"]","items":{"type":"string"},"description":"Never follow links whose address matches one of these patterns (for example logout|cart).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"ignore_query":{"type":"boolean","default":true,"description":"true (default): treat addresses that differ only after the ? as one page, so filters and tracking codes do not multiply the pages.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"width":{"type":"integer","minimum":240,"maximum":3840,"default":1280,"description":"The browser width in pixels, 240 to 3840 (default 1280).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"height":{"type":"integer","minimum":200,"maximum":4000,"default":800,"description":"The browser height in pixels, 200 to 4000 (default 800).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"device":{"type":"string","example":"iphone-14","description":"A device preset such as iphone-14 or pixel-7 (sets the size, the pixel ratio and the user agent; the same names as the html-to-image tool).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"full_page":{"type":"boolean","default":true,"description":"true (default): the whole length of the page. false: only what the browser window shows.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"max_height":{"type":"integer","minimum":200,"maximum":30000,"default":12000,"description":"With full_page: the tallest picture to make, 200 to 30000 pixels (default 12000); longer pages are cut and marked truncated.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"default":1,"description":"The pixel ratio of the picture, 1 to 3 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"format":{"type":"string","enum":["png","jpeg","webp"],"default":"png","description":"png (default), jpeg or webp.","x-davix-h2i-enum":"Format","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"default":85,"description":"For jpeg and webp: the quality, 1 to 100 (default 85).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"wait_until":{"type":"string","enum":["load","domcontentloaded","networkidle0","networkidle2"],"default":"load","description":"When a page counts as loaded: load (default), domcontentloaded, networkidle0 or networkidle2.","x-davix-h2i-enum":"RenderSiteCaptureWaitUntil","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"delay_ms":{"type":"integer","minimum":0,"maximum":10000,"default":300,"description":"Wait this long after a page has loaded before the picture, 0 to 10000 ms (default 300).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"scroll":{"type":"boolean","default":true,"description":"true (default): scroll down the page first so lazily loaded pictures appear.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"color_scheme":{"type":"string","enum":["light","dark"],"description":"light or dark: the preference the pages see (for sites that have a dark mode).","x-davix-h2i-enum":"RenderSiteCaptureColorScheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"hide_selectors":{"type":"array","example":"[\"#cookie-banner\",\".chat-widget\"]","items":{"type":"string"},"description":"CSS selectors of things to hide before the picture, for example a cookie banner or a chat bubble.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"block_resources":{"type":"array","example":"[\"media\"]","items":{"type":"string"},"description":"Resource types not to load: image, stylesheet, font, media, script, and others.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"user_agent":{"type":"string","example":"Mozilla/5.0 (compatible; SiteCheck)","description":"The browser identity the pages see.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"bundle":{"type":"string","enum":["none","zip"],"default":"none","description":"none (default: one picture per page) or zip (also one ZIP with all pictures and a manifest.json).","x-davix-h2i-enum":"RenderBundle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"time_limit_seconds":{"type":"integer","minimum":10,"maximum":120,"default":60,"description":"Stop capturing after this long, 10 to 120 (default 60); the pictures taken so far are returned and stopped says why.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/site-capture.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["url"]},"encoding":{"urls":{"contentType":"application/json"},"include":{"contentType":"application/json"},"exclude":{"contentType":"application/json"},"hide_selectors":{"contentType":"application/json"},"block_resources":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width?, height?, pageUrl?, title?, depth?, truncated?, pages? }], captured, found, stopped, skipped: [{ url, reason }], start }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["png","jpeg","webp","zip"]},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"pageUrl":{"type":"string","description":"The address of the page this picture shows (after redirects)."},"title":{"type":"string"},"depth":{"type":"integer","description":"How many clicks from the start address."},"truncated":{"type":"boolean","description":"true when the page was longer than max_height."},"pages":{"type":"integer","description":"On the ZIP: how many pictures it holds."}},"required":["url","format","sizeBytes"]}},"captured":{"type":"integer","description":"How many pages were captured (what is counted)."},"found":{"type":"integer","description":"How many different pages were found, captured or not."},"stopped":{"type":"string","enum":["max_pages","time_limit"],"description":"Why the capture ended before all pages were done; null when it ran to the end."},"skipped":{"type":"array","items":{"type":"object"},"description":"Pages that could not be captured: url and reason."},"start":{"type":"string"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results","captured","found","skipped","start"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.site-capture","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_url_ingestion","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/site-capture\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'url=https://example.com/' \\\n  -F 'urls=[\"/pricing\",\"/about\"]' \\\n  -F 'max_pages=5'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.siteCapture({\n    \"url\": \"https://example.com/\",\n    \"urls\": \"[\\\"/pricing\\\",\\\"/about\\\"]\",\n    \"max_pages\": 5\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->siteCapture([\n    'url' => 'https://example.com/',\n    'urls' => '[\"/pricing\",\"/about\"]',\n    'max_pages' => 5,\n]);\necho $result->requestId;"}]}},"/v1/render/table":{"post":{"operationId":"render.table","summary":"Table to image","description":"Turn a table (pasted CSV or JSON, or a data file) into a clean picture for slides, reports and posts, with themes, stripes, borders and a title.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"string","maxLength":500000,"example":"Country,Orders\nGermany,12\nFrance,8","description":"The table: CSV or TSV text with a header row, a JSON list of objects, or a JSON list of lists whose first list is the header. Use this or data_file.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Neither data nor data_file -> 400 missing_field; both -> 400. More than 40 columns -> 400.","evidence":"src/processing/render/table-image.js"}},"data_file":{"type":"array","items":{"type":"string","format":"binary"},"description":"A CSV, TSV, XLSX, ODS or JSON file to draw instead of data (first sheet; the first row is the column names). Send the file, or its web address in data_file_url.","x-davix-h2i-file":{"mimeTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/markdown","text/html","application/vnd.ms-excel","text/csv","application/json","application/xml","text/tab-separated-values","application/x-ndjson","application/yaml","application/toml","application/vnd.sqlite3","application/sql","application/vnd.apache.parquet"],"extensions":["xlsx","ods","md","markdown","html","htm","xhtml","xls","xlt","csv","json","xml","tsv","tab","ndjson","jsonl","yaml","yml","toml","sqlite","sqlite3","db","sql","parquet"],"note":"Send either data or data_file, not both. The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"title":{"type":"string","maxLength":200,"description":"A heading above the table.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"output":{"type":"string","enum":["png","jpeg","webp","avif"],"default":"png","description":"png (default), jpeg, webp or avif.","x-davix-h2i-enum":"PictureOutput","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","blue","green","minimal"],"default":"light","description":"Look of the table: light (default), dark, blue, green or minimal.","x-davix-h2i-enum":"RenderTableTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"striped":{"type":"boolean","default":true,"description":"true (default): every second row has a light band.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"borders":{"type":"string","enum":["rows","all","none"],"default":"rows","description":"Lines: rows (default, between rows), all (around every cell) or none.","x-davix-h2i-enum":"RenderBorders","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"font_size":{"type":"number","minimum":8,"maximum":40,"default":14,"description":"Text size in pixels, 8 to 40 (default 14).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"padding":{"type":"number","minimum":0,"maximum":200,"default":24,"description":"Space around the table in pixels, 0 to 200 (default 24).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"width":{"type":"number","minimum":200,"maximum":4000,"description":"A fixed width in pixels (200 to 4000): the columns share it and long text wraps. Default: as wide as the content.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"max_rows":{"type":"integer","minimum":1,"maximum":300,"default":300,"description":"Draw only the first rows (1 to 300, default 300). The answer says truncated when rows were left out.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"background":{"type":"string","format":"color","example":"#ffffff","description":"Background colour: #rgb, #rrggbb, #rrggbbaa or transparent (not with jpeg). Default: the theme's own. Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Background colour. Anything that is not #rgb, #rrggbb, #rrggbbaa or transparent -> 400.","evidence":"src/processing/render/picture-params.js"}},"lang":{"type":"string","example":"ar","description":"Language code of the text, for example ar or ja, so the right fonts and reading direction are used.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/table-image.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"quality":{"type":"integer","minimum":1,"maximum":100,"description":"jpeg / webp / avif quality, 1-100.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"data_file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, rows, columns, truncated? }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"},"rows":{"type":"integer","description":"Rows drawn."},"columns":{"type":"integer","description":"Columns drawn."},"truncated":{"type":"boolean","description":"true when rows were left out because of max_rows or the 300-row limit."}},"required":["url","format","sizeBytes","width","height"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"data_file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.table","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_fmt_data_extended","allow_fmt_legacy_office","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/table\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'data=Country,Orders\nGermany,12\nFrance,8' \\\n  -F 'output=png' \\\n  -F 'theme=light'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.table({\n    \"data\": \"Country,Orders\\nGermany,12\\nFrance,8\",\n    \"output\": \"png\",\n    \"theme\": \"light\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->table([\n    'data' => 'Country,Orders\nGermany,12\nFrance,8',\n    'output' => 'png',\n    'theme' => 'light',\n]);\necho $result->requestId;"}]}},"/v1/render/timeline":{"post":{"operationId":"render.timeline","summary":"Timeline / Gantt","description":"Draw a Gantt chart (a bar per task on a time axis, groups, progress, milestones, dependencies, a today line) or a timeline (a line with the events above and below) from a list of tasks and dates.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","example":"[{\"label\":\"Design\",\"start\":\"2026-01-05\",\"end\":\"2026-02-10\"}]","items":{"type":"object","properties":{"label":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"},"group":{"type":"string"},"color":{"type":"string","format":"color","description":"Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk()."},"progress":{"type":"number"},"milestone":{"type":"boolean"},"id":{"type":"string"},"depends_on":{"type":"string"},"note":{"type":"string"}},"required":["label","start"]},"description":"The tasks or events: a list of { label, start, end?, group?, color?, progress? (0-100), milestone?, id?, depends_on? (ids), note? }. Without an end, or with milestone, an item is a point in time.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"style":{"type":"string","enum":["gantt","timeline"],"default":"gantt","description":"gantt (default) or timeline.","x-davix-h2i-enum":"RenderTimelineStyle","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"axis":{"type":"string","enum":["auto","day","week","month","quarter","year"],"default":"auto","description":"The steps of the time axis: auto (default), day, week, month, quarter or year.","x-davix-h2i-enum":"RenderAxis","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"show_today":{"type":"boolean","default":true,"description":"true (default): a line for today.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"today":{"type":"string","example":"2026-03-01","description":"The date of the today line (default now).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"group_rows":{"type":"boolean","default":true,"description":"true (default): a header row for every group.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"show_dates":{"type":"boolean","default":false,"description":"true: write the dates next to the bars. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"dependencies":{"type":"boolean","default":true,"description":"true (default): arrows from an item to the items that depend on it.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"grid":{"type":"boolean","default":true,"description":"true (default): vertical grid lines.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"sort":{"type":"string","enum":["input","start","end"],"default":"input","description":"input (default), start or end.","x-davix-h2i-enum":"RenderSort","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"padding_days":{"type":"integer","minimum":0,"maximum":365,"default":0,"description":"Extra days before and after, 0 to 365 (default 0).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"row_height":{"type":"integer","minimum":18,"maximum":80,"default":30,"description":"gantt: the height of a row in pixels, 18 to 80 (default 30).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"label_width":{"type":"integer","minimum":80,"maximum":600,"default":220,"description":"gantt: the width of the label column in pixels, 80 to 600 (default 220).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/timeline.js"}},"output":{"type":"string","enum":["png","pdf","svg"],"default":"png","description":"png (a picture), pdf, svg (scalable). Default png.","x-davix-h2i-enum":"RenderOutput3","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"width":{"type":"integer","minimum":200,"maximum":4000,"default":1200,"description":"The width in pixels, 200 to 4000 (default 1200).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"height":{"type":"integer","minimum":100,"maximum":8000,"description":"The height in pixels, 100 to 8000 (default: fitted to the content).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","warm","mono"],"default":"light","description":"The colours: light, dark, warm, mono (default light).","x-davix-h2i-enum":"RenderTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"palette":{"type":"string","enum":["default","pastel","vivid","mono","ocean","sunset"],"default":"default","description":"The colours of the data: default, pastel, vivid, mono, ocean, sunset (default default).","x-davix-h2i-enum":"RenderPalette","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"font":{"type":"string","enum":["sans","serif","mono","rounded","hand"],"default":"sans","description":"The font: sans, serif, mono, rounded, hand (default sans).","x-davix-h2i-enum":"RenderFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"background":{"type":"string","format":"color","example":"#fffaf0","description":"The background as a hex colour, or transparent (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"title":{"type":"string","example":"Q4 plan","description":"A title (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"subtitle":{"type":"string","example":"January to June","description":"A line under the title (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["items"]},"encoding":{"items":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, style, items, rows, unit, from, to }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","description":"The width of the picture or page in pixels."},"height":{"type":"integer","description":"The height of the picture or page in pixels."},"style":{"type":"string","enum":["gantt","timeline"]},"items":{"type":"integer"},"rows":{"type":"integer","description":"How many task rows are drawn."},"unit":{"type":"string","description":"The step of the time axis that was used."},"from":{"type":"string","description":"The first day of the time axis."},"to":{"type":"string","description":"The last day of the time axis."}},"required":["url","format","sizeBytes","style","items","rows","unit","from","to"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout"],"x-davix-h2i-id":"render.timeline","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/timeline\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'items=[{\"label\":\"Design\",\"start\":\"2026-01-05\",\"end\":\"2026-02-10\"}]' \\\n  -F 'style=gantt' \\\n  -F 'axis=auto'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.timeline({\n    \"items\": \"[{\\\"label\\\":\\\"Design\\\",\\\"start\\\":\\\"2026-01-05\\\",\\\"end\\\":\\\"2026-02-10\\\"}]\",\n    \"style\": \"gantt\",\n    \"axis\": \"auto\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->timeline([\n    'items' => '[{\"label\":\"Design\",\"start\":\"2026-01-05\",\"end\":\"2026-02-10\"}]',\n    'style' => 'gantt',\n    'axis' => 'auto',\n]);\necho $result->requestId;"}]}},"/v1/render/visual-check":{"post":{"operationId":"render.visual-check","summary":"Visual change check","description":"Compare two pictures (before and after a change) pixel by pixel: how much changed, where (boxes around the changed areas), and a picture that shows the changes in colour, side by side, blended or as a black-and-white mask. Ignore areas, tolerate small colour differences and set how much change you allow.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The first picture (before).","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"other":{"type":"string","format":"binary","description":"The second picture (after). It must be as large as the first unless fit is set.","x-davix-h2i-file":{"mimeTypes":["image/jpeg","image/png","image/webp","image/gif","image/avif","image/tiff","image/svg+xml","image/svg+xml-compressed","image/bmp","image/x-icon","image/apng","image/x-portable-anymap","image/x-tga","image/vnd.ms-dds","image/jxl","image/jp2","image/vnd.adobe.photoshop","image/x-raw","application/postscript","application/illustrator","application/x-postscript"],"extensions":["jpg","jpeg","jpe","jfif","png","webp","gif","avif","tif","tiff","svg","svgz","bmp","dib","ico","apng","pnm","ppm","pgm","pbm","tga","dds","jxl","jp2","j2k","jpf","jpx","j2c","psd","psb","dng","cr2","cr3","nef","arw","orf","rw2","raf","pef","srw","eps","epsf","epsi","ai","ps"]}},"mode":{"type":"string","enum":["overlay","side-by-side","mask","blend"],"default":"overlay","description":"overlay (default: changes in colour on a faded copy of the first), side-by-side (first, second and the changes), blend (both pictures mixed, changes in colour) or mask (black where it changed).","x-davix-h2i-enum":"RenderMode","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"threshold":{"type":"number","minimum":0,"maximum":1,"default":0.1,"description":"How different a colour must be to count as a change, 0 (every difference) to 1 (default 0.1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"ignore_antialiasing":{"type":"boolean","default":true,"description":"true (default): do not count the soft edges of text and shapes.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"fit":{"type":"string","enum":["strict","cover","contain","stretch"],"default":"strict","description":"strict (default: both pictures must be the same size), cover, contain or stretch (the second picture is fitted to the size of the first).","x-davix-h2i-enum":"RenderFit","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"ignore_regions":{"type":"array","example":"[{\"x\":10,\"y\":10,\"width\":120,\"height\":30}]","items":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"}},"required":["x","y","width","height"]},"description":"Areas to ignore (a clock, an ad): a list of { x, y, width, height } in pixels of the first picture.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"max_change_percent":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"The share of changed pixels you allow, 0 to 100 (default 0). The answer says changed: true when more changed.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"highlight_color":{"type":"string","format":"color","default":"#ff2d55","example":"#00ff00","description":"The colour of the changes as a hex colour (default #ff2d55). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"fade":{"type":"number","minimum":0,"maximum":1,"default":0.55,"description":"overlay: how much the first picture is faded, 0 to 1 (default 0.55).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"draw_boxes":{"type":"boolean","default":true,"description":"true (default): draw a box around every changed area.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"box_grid":{"type":"integer","minimum":4,"maximum":200,"default":24,"description":"The size in pixels of the cells that join nearby changes into one box, 4 to 200 (default 24).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"min_box_pixels":{"type":"integer","minimum":1,"maximum":100000,"default":4,"description":"The fewest changed pixels a box needs, 1 to 100000 (default 4).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"gap":{"type":"integer","minimum":0,"maximum":80,"default":12,"description":"side-by-side: the space between the pictures in pixels, 0 to 80 (default 12).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/visual-check.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}},"required":["file","other"]},"encoding":{"ignore_regions":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format: \"png\", sizeBytes, width, height, changed, changedPixels, changedPercent, boxes: [{ x, y, width, height, pixels }], boxCount, sizes: { first, second }, mode }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","description":"The width of the picture or page in pixels."},"height":{"type":"integer","description":"The height of the picture or page in pixels."},"changed":{"type":"boolean","description":"true when more than max_change_percent of the pixels changed."},"changedPixels":{"type":"integer"},"changedPercent":{"type":"number","description":"The share of changed pixels, in percent."},"boxes":{"type":"array","items":{"type":"object"},"description":"x, y, width, height and pixels of the biggest changed areas (up to 100)."},"boxCount":{"type":"integer"},"sizes":{"type":"object","description":"first and second: the size [width, height] of each picture."},"mode":{"type":"string"}},"required":["url","format","sizeBytes","changed","changedPixels","changedPercent","boxes","boxCount","sizes","mode"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"combine","field":"file","minFiles":2,"ceiling":1,"directFiles":1,"multiFile":"native","multipleToggle":false,"fixedFiles":true,"either":false},"x-davix-h2i-id":"render.visual-check","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","upload_mb_per_request","max_file_size_bytes","allow_fmt_layered_raw","allow_fmt_postscript","allow_fmt_raster_extended","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/visual-check\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'other=@photo.jpg' \\\n  -F 'mode=overlay' \\\n  -F 'threshold=0.1' \\\n  -F 'fit=strict'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.visualCheck({\n    \"file\": 'document.pdf',\n    \"other\": 'photo.jpg',\n    \"mode\": \"overlay\",\n    \"threshold\": 0.1,\n    \"fit\": \"strict\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->visualCheck([\n    'file' => 'document.pdf',\n    'other' => 'photo.jpg',\n    'mode' => 'overlay',\n    'threshold' => 0.1,\n    'fit' => 'strict',\n]);\necho $result->requestId;"}]}},"/v1/render/word-cloud":{"post":{"operationId":"render.word-cloud","summary":"Word cloud","description":"Turn a text (or a list of words with weights) into a word cloud: the more often a word occurs, the bigger it is. Common words are left out, words are placed without overlap in a rectangle, ellipse or heart, horizontal or turned; the same seed gives the same picture.","tags":["Render"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional idempotency key (8-128 characters). Reuse it for a retry of the SAME request; a different request with the same key -> 409 idempotency_key_conflict."},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"},"description":"A text file with the text (instead of the text field).","x-davix-h2i-file":{"note":"Any file type is accepted by the upload; the tool answers 400 invalid_parameter when it cannot read it. Size limits are plan/settings limits (runtime). The operation handles one file per run; send several files in this field and each is processed on its own, answered as one result per file. How many files one request may carry is set by the plan (files per request)."}},"text":{"type":"string","example":"cloud server data cloud network","description":"The text (up to 2 million characters). Send this, a file or words.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/word-cloud.js"}},"words":{"type":"array","example":"[{\"text\":\"cloud\",\"weight\":10}]","items":{"type":"object","properties":{"text":{"type":"string"},"weight":{"type":"number"}},"required":["text","weight"]},"description":"Instead of a text: the words with their weights, as a list of { text, weight } or [text, weight].","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"language":{"type":"string","enum":["en","de","es","fr","pt","it","none"],"default":"en","description":"The language of the common words to leave out: en, de, es, fr, pt, it, none (default en; none keeps every word).","x-davix-h2i-enum":"RenderLanguage","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"stopwords":{"type":"array","example":"[\"lorem\",\"ipsum\"]","items":{"type":"string"},"description":"More words to leave out.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"keep_words":{"type":"array","example":"[\"not\"]","items":{"type":"string"},"description":"Words to keep although they are common.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"max_words":{"type":"integer","minimum":5,"maximum":500,"default":100,"description":"How many words, 5 to 500 (default 100).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"min_length":{"type":"integer","minimum":1,"maximum":20,"default":3,"description":"The shortest word, 1 to 20 letters (default 3).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"min_count":{"type":"integer","minimum":1,"maximum":1000,"default":1,"description":"A word must occur at least this often, 1 to 1000 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"numbers":{"type":"boolean","default":false,"description":"true: numbers count as words. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"case":{"type":"string","enum":["lower","keep","title"],"default":"lower","description":"lower (default), keep (as written) or title (Capitalised).","x-davix-h2i-enum":"RenderCase","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"weight":{"type":"string","enum":["count","log","rank"],"default":"count","description":"How size follows the count: count (default), log (flatter) or rank.","x-davix-h2i-enum":"RenderWeight","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"shape":{"type":"string","enum":["rectangle","ellipse","heart"],"default":"ellipse","description":"The shape of the cloud: rectangle, ellipse (default) or heart.","x-davix-h2i-enum":"RenderShape","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"rotation":{"type":"string","enum":["none","quarter","mixed"],"default":"quarter","description":"none, quarter (default: some words turned 90 degrees) or mixed (also 45 degrees).","x-davix-h2i-enum":"RenderRotation","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"default":1,"description":"The same seed gives the same picture, 0 to 2147483647 (default 1).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"font_min":{"type":"number","minimum":6,"maximum":100,"default":14,"description":"The smallest word in pixels, 6 to 100 (default 14).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"font_max":{"type":"number","minimum":10,"maximum":400,"default":120,"description":"The biggest word in pixels, 10 to 400 (default 120).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"spacing":{"type":"number","minimum":0,"maximum":30,"default":4,"description":"The space between words in pixels, 0 to 30 (default 4).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"bold":{"type":"boolean","default":true,"description":"true (default): bold words.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"color":{"type":"string","format":"color","example":"#0077b6","description":"One colour for every word as a hex colour (default: the palette). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"uniform_color":{"type":"boolean","default":false,"description":"true: every word in the text colour of the theme. Default false.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/word-cloud.js"}},"output":{"type":"string","enum":["png","pdf","svg"],"default":"png","description":"png (a picture), pdf, svg (scalable). Default png.","x-davix-h2i-enum":"RenderOutput3","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"width":{"type":"integer","minimum":200,"maximum":4000,"default":1200,"description":"The width in pixels, 200 to 4000 (default 1200).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"height":{"type":"integer","minimum":100,"maximum":8000,"default":800,"description":"The height in pixels, 100 to 8000 (default 800).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"scale":{"type":"number","minimum":1,"maximum":3,"description":"Image pixel ratio, 1 to 3 (default 2).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/api/render/chart.js"}},"theme":{"type":"string","enum":["light","dark","warm","mono"],"default":"light","description":"The colours: light, dark, warm, mono (default light).","x-davix-h2i-enum":"RenderTheme","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"palette":{"type":"string","enum":["default","pastel","vivid","mono","ocean","sunset"],"default":"default","description":"The colours of the data: default, pastel, vivid, mono, ocean, sunset (default default).","x-davix-h2i-enum":"RenderPalette","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"font":{"type":"string","enum":["sans","serif","mono","rounded","hand"],"default":"sans","description":"The font: sans, serif, mono, rounded, hand (default sans).","x-davix-h2i-enum":"RenderFont","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"background":{"type":"string","format":"color","example":"#fffaf0","description":"The background as a hex colour, or transparent (default: from the theme). Any colour format works: #rrggbb, rgb(), hsl(), hwb() or cmyk().","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"title":{"type":"string","example":"Q4 plan","description":"A title (up to 200 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"subtitle":{"type":"string","example":"January to June","description":"A line under the title (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/render/page-output.js"}},"validate_only":{"type":"boolean","default":false,"description":"true = check the request without running it. The answer is `{ validated: true, valid, errors[], files, estimate, limits }` instead of the endpoint's usual answer: `errors` lists every parameter or file the real call would reject, `estimate` is what it would count against your plan, and `limits` are the limits that apply to this endpoint for your key. Nothing is processed, no files are produced and no files are counted against the plan; the call itself counts as one request. The tool’s own checks run on it too, up to the point where processing would start; a problem that only shows while processing (a crop outside the image) is not found. Files given as a web address are not downloaded.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only \"true\" enables it","evidence":"src/platform/validation/validate-only.js; src/platform/processing-hooks/index.js"}},"presetId":{"type":"string","format":"uuid","description":"Apply a saved preset (create one with POST /v1/presets). Every value stored in the preset is used unless this request sets that field itself. The preset must have been saved for this same endpoint; requires an individual customer API key."},"response":{"type":"string","enum":["url","binary","base64"],"default":"url","description":"How the result comes back. url (default) = the usual JSON answer with a signed URL per file. binary = the file itself as the HTTP body with Content-Type and Content-Disposition (a request with several result files returns one zip). base64 = the JSON answer with each result carrying `data` (base64) and `mimeType` instead of `url`, up to 20 MB in total. Answers without a result file are returned as JSON either way. Not available together with `async: true`.","x-davix-h2i-enum":"Response","x-davix-h2i-behavior":{"onInvalid":"reject","normalization":"lower-cased","note":"Any other value -> 400 invalid_parameter. Combined with async: true (binary / base64) -> 400 invalid_parameter. Results above 300 MB (binary, several files) or 20 MB (base64) are not inlined: the JSON answer lists the files as usual and carries response_error / base64_error.","evidence":"src/platform/uploads/response-mode.js; src/platform/processing-hooks/index.js"}},"filename":{"type":"string","maxLength":255,"description":"The name for the result file (without extension; the extension follows the format). Used as the download name: Content-Disposition for response=binary, `downloadName` in the JSON answer otherwise. Path separators, control and bidirectional characters and Windows-reserved characters are removed; names are capped at 150 bytes. Several result files get -1, -2 ... added.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"sanitised (never rejected for its characters); longer than 255 characters -> 400 invalid_parameter; together with filename_template -> 400 invalid_parameter","evidence":"src/platform/uploads/response-mode.js:sanitizeFilename"}},"filename_template":{"type":"string","maxLength":200,"description":"A name built per result file from placeholders: {name} (the input file name without extension), {index} (1, 2, ...), {date} (YYYY-MM-DD), {time} (HH-MM-SS, UTC), {format} (the result extension) and {operation}. Example: \"{name}-{index}-{date}\". Sanitised like filename; result files that would get the same name are numbered -2, -3 ... Not together with filename.","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown placeholder or an unmatched brace -> 400 invalid_parameter.","evidence":"src/platform/uploads/response-mode.js:renderTemplate"}},"app":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the app that makes this call, for example \"My shop importer\". It is shown in your History next to the result, so you can tell which app did what. The official apps fill it in themselves (Davix H2I plugin, Davix H2I n8n node, Davix H2I Studio, Davix H2I Dashboard); when you leave it out, the official SDKs and plugins are recognised from their User-Agent. Up to 60 characters; control characters and angle brackets are removed. The header `X-Davix-App` does the same. It is only a label: it never changes what the call does.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"plain text, one line, cut to 60 characters; blank = not set","evidence":"src/shared/request-app.js:cleanApp"}},"source_url":{"type":"string","format":"uri","maxLength":2048,"description":"Fetch the input from this public http(s) address instead of uploading a file in \"file\". Send either the file or source_url, not both. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; the fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed.","evidence":"src/platform/uploads/url-ingest.js"}},"source_urls":{"type":"array","maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048},"description":"A list of public http(s) addresses to fetch as inputs, as a JSON array, for example [\"https://example.com/a.pdf\",\"https://example.com/b.pdf\"]. They are added to any files you upload: uploaded files come first, then the URLs, in the order sent. Together they cannot exceed the files-per-request limit of your plan. Only public addresses on port 80/443 are fetched (never loopback, private, link-local or cloud-metadata addresses), redirects are re-checked, and the download is size- and time-limited; every fetched file is then judged exactly like an upload (content sniffing, format and size limits).","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not an http(s) URL, credentials in the URL, or an address that is not public -> 400 url_blocked; a download that fails, is too slow or redirects too often -> 400 url_fetch_failed; larger than the limit -> 413 file_too_large; a plan without URL input -> 403 format_not_allowed; a file and a URL for the same input -> 400 invalid_parameter.","evidence":"src/platform/uploads/url-ingest.js"}},"async":{"type":"boolean","description":"Opt-in asynchronous execution. With async=true and an individual customer API key the endpoint answers 202 {job_id, status_url} and the result becomes available from GET /v1/jobs/{id}. Omitted/false = the normal synchronous response. A request that carries several files in one field is not run as a job: it is processed immediately, answered with one result per file, and a `warnings` entry says that async was not applied.","x-davix-h2i-behavior":{"onInvalid":"normalize","normalization":"only boolean true or the string \"true\" enables it","note":"With any other key type the request is rejected with 400 async_requires_customer_key.","evidence":"src/api/images/shared.js:isAsyncRequested"}}}},"encoding":{"words":{"contentType":"application/json"},"stopwords":{"contentType":"application/json"},"keep_words":{"contentType":"application/json"},"source_urls":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"{ results: [{ url, format, sizeBytes, width, height, words, candidates, dropped, top: [{ word, count }] }] }","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"format":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":"integer","description":"The width of the picture or page in pixels."},"height":{"type":"integer","description":"The height of the picture or page in pixels."},"words":{"type":"integer","description":"How many words were placed."},"candidates":{"type":"integer","description":"How many different words the text had after the filters."},"dropped":{"type":"integer","description":"Words that did not fit."},"top":{"type":"array","items":{"type":"object"},"description":"The ten most common words: word and count."}},"required":["url","format","sizeBytes","words","candidates","dropped","top"]}},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"202":{"description":"Accepted (async job created).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","async_limit_reached","async_not_allowed","async_requires_customer_key","endpoint_api_disabled","endpoint_disabled","endpoint_not_allowed","file_too_large","html_render_failed","html_too_large","idempotency_key_conflict","internal_error","invalid_api_key","invalid_idempotency_key","invalid_parameter","invalid_upload","key_expired","key_quota_exceeded","missing_field","monthly_quota_exceeded","plan_quota_not_configured","plan_resolution_failed","rate_limit_exceeded","rate_limit_unavailable","render_size_exceeded","server_busy","timeout","too_many_files","total_upload_exceeded","unsupported_media_type","url_blocked","url_fetch_failed"],"x-davix-h2i-uploads":{"accepts":true,"shape":"batch","field":"file","minFiles":0,"ceiling":null,"directFiles":1,"multiFile":"fan-out","multipleToggle":true,"either":false},"x-davix-h2i-id":"render.word-cloud","x-davix-h2i-audience":"public","x-davix-h2i-platform":{"quotaBucket":"render","rateLimitCategory":"render","supportedMetrics":["requests","upload_bytes","response_bytes","files","timeout_seconds","html_max_chars","render_max_width","render_max_height","render_max_pixels","files_per_request","upload_mb_per_request","max_file_size_bytes","multiple_uploads","allow_url_ingestion","url_download_max_bytes","allow_async_jobs","max_active_jobs","job_queue_wait_seconds","jobs_started"],"jobEligible":true,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/render/word-cloud\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'text=cloud server data cloud network' \\\n  -F 'words=[{\"text\":\"cloud\",\"weight\":10}]' \\\n  -F 'language=en'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.render.wordCloud({\n    \"text\": \"cloud server data cloud network\",\n    \"words\": \"[{\\\"text\\\":\\\"cloud\\\",\\\"weight\\\":10}]\",\n    \"language\": \"en\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->render()->wordCloud([\n    'text' => 'cloud server data cloud network',\n    'words' => '[{\"text\":\"cloud\",\"weight\":10}]',\n    'language' => 'en',\n]);\necho $result->requestId;"}]}},"/v1/reports":{"post":{"operationId":"reports","summary":"Send the team a short note about a problem (a quick report, not a support ticket)","description":"Used by the Studio's report button. Who sent it, their plan and the failed request are read by the server from the key; the body adds context only. Typed text and secrets in `settings` are hidden before anything is kept, and file contents and names are never kept. A customer is allowed a few reports per hour; the same failed request is saved once.","tags":["Account"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":5,"maxLength":2000,"description":"What went wrong, in the person's own words.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"tool":{"type":"string","description":"The id of the tool on screen, such as pdfs.merge.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"area":{"type":"string","enum":["studio","dashboard"],"description":"The app the report was sent from: studio or dashboard (the Customer Portal).","x-davix-h2i-enum":"AccountArea","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"where":{"type":"object","description":"Where in the app the person was: the title on screen and the tabs chosen (title, tabs).","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"kind":{"type":"string","enum":["manual","error"],"description":"manual (the report button) or error (the Report button of an error).","x-davix-h2i-enum":"AccountKind","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"request_id":{"type":"string","description":"The request id of the failed request, when the report is about one.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"error":{"type":"object","description":"The error the person saw: code, status, message, request_id.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"settings":{"type":"object","description":"The tool's settings on screen. Secrets and typed text are hidden.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"files":{"type":"array","items":{},"description":"The kind and size of each file ({ ext, type, size }); never the files or their names.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"view":{"type":"object","description":"The screen: mode, language, viewport, touch, page.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"release":{"type":"string","description":"The version of the Studio.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}},"hp":{"type":"string","description":"A box that must stay empty: a robot fills it and the report is dropped.","x-davix-h2i-behavior":{"onInvalid":"normalize","evidence":"src/platform/bug-reports/clean.js"}}},"required":["message"]}}}},"responses":{"200":{"description":"{ ok, report_id, duplicate }","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"report_id":{"type":"string"},"duplicate":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["ok","report_id","duplicate"]}}}},"201":{"description":"{ ok, report_id, duplicate }","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"report_id":{"type":"string"},"duplicate":{"type":"boolean"},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["ok","report_id","duplicate"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Quota or rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","rate_limited"],"x-davix-h2i-id":"reports","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":true},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/reports\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"message\":\"xxxxx\",\"area\":\"studio\",\"kind\":\"manual\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.reports.create({\n    \"message\": \"xxxxx\",\n    \"area\": \"studio\",\n    \"kind\": \"manual\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->reports()->create([\n    'message' => 'xxxxx',\n    'area' => 'studio',\n    'kind' => 'manual',\n]);\necho $result->requestId;"}]}},"/v1/subscription":{"get":{"operationId":"subscription","summary":"The authenticated customer's own subscription status, plan detail, and current usage.","description":"The authenticated customer's own subscription status, plan detail, and current usage.","tags":["Subscriptions"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"subscription":{"type":"object","properties":{"api_key_id":{"type":"integer"},"subscription_id":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"subscription_status":{"type":"string","nullable":true},"key_status":{"type":"string","nullable":true},"valid_from":{"type":"string","format":"date-time","nullable":true},"valid_until":{"type":"string","format":"date-time","nullable":true},"is_currently_valid":{"type":"boolean"},"invalid_reason":{"type":"string","nullable":true}},"required":["api_key_id","is_currently_valid"],"nullable":true},"plan":{"type":"object","properties":{"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"is_free":{"type":"boolean"},"billing_period":{"type":"string","nullable":true},"monthly_quota_files":{"type":"integer","nullable":true},"quota_mode":{"type":"string","enum":["monthly_both","monthly_scoped_only","monthly_total_only"]},"allowed_endpoints":{"$ref":"#/components/schemas/EndpointAccess"},"limits":{"type":"object","properties":{"render":{"type":"integer","nullable":true},"image":{"type":"integer","nullable":true},"pdf":{"type":"integer","nullable":true},"ai":{"type":"integer","nullable":true},"data":{"type":"integer","nullable":true},"documents":{"type":"integer","nullable":true}}}},"required":["is_free","quota_mode","allowed_endpoints"]},"usage":{"allOf":[{"$ref":"#/components/schemas/UsageSummary"}],"nullable":true},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["plan"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"subscription","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/subscription\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.subscription.get();\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->subscription()->get();\necho $result->requestId;"}]}},"/v1/templates":{"get":{"operationId":"templates","summary":"List templates","description":"List templates","tags":["Templates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["html","docx"],"x-davix-h2i-enum":"TemplatesKind","x-davix-h2i-behavior":{"onInvalid":"ignore","note":"An unknown kind returns an empty list.","evidence":"src/api/templates/list.js"}},"description":"Only return templates of this kind."}],"responses":{"200":{"description":"Your templates (without their html/css) and the plan limit.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"limit":{"type":"integer","nullable":true,"description":"The most templates the plan allows (empty = no plan limit)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["results"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"templates","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/templates?kind=html\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.templates.list({\n    \"kind\": \"html\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->templates()->list([\n    'kind' => 'html',\n]);\necho $result->requestId;"}]},"post":{"operationId":"templates.post","summary":"Create a template","description":"Save an HTML document with {{variables}} to render later with templateId (html-to-pdf, html-to-image). A template holds content only; the settings of a render stay in presets or in the request.","tags":["Templates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Template name (1-100 characters after trimming); unique per account.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","normalization":"trimmed","note":"Duplicate name -> 409 duplicate_template_name. The number of templates is limited by the plan.","evidence":"src/processing/templates/service.js:validateName"}},"kind":{"type":"string","enum":["html"],"default":"html","description":"html (the only kind created here). DOCX / ODT templates for mail-merge are created with POST /v1/templates/upload.","x-davix-h2i-enum":"TemplatesPostKind","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Another kind -> 400 invalid_parameter.","evidence":"src/api/templates/create.js"}},"description":{"type":"string","maxLength":300,"description":"A short note about the template (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/templates/service.js:validateDescription"}},"html":{"type":"string","description":"The document, with {{name}} / {{a.b}} placeholders. A placeholder that is the whole value of src, href or a CSS url() takes a web address or an image data: URI; everywhere else its value is HTML-escaped. No expression language: a value can never become markup or script.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/templates/service.js:validateHtmlContent"}},"css":{"type":"string","description":"CSS for the document; {{variables}} in it are filled too (their values may not contain braces, semicolons, quotes, angle brackets, backslashes or comments).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/templates/service.js:validateHtmlContent"}},"variables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"A variable the text uses, e.g. customer_name or customer.name."},"default":{"type":"string","description":"Used when a request leaves this variable empty."},"required":{"type":"boolean","description":"When true, a request that leaves it empty (and no default) is refused."},"description":{"type":"string","maxLength":200,"description":"A note for whoever uses the template."}},"required":["name"]},"description":"Details of the variables the html and css use. The variables themselves are found automatically from {{name}} placeholders; list one here only to give it a default, mark it required or describe it. A name the text does not use is refused."}},"required":["name","html"]}}}},"responses":{"201":{"description":"The created template, with the variables found in it.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Template"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","duplicate_template_name","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-id":"templates.post","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/templates\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"x\",\"kind\":\"html\",\"html\":\"<h1>Hello</h1>\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.templates.create({\n    \"name\": \"x\",\n    \"kind\": \"html\",\n    \"html\": \"<h1>Hello</h1>\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->templates()->create([\n    'name' => 'x',\n    'kind' => 'html',\n    'html' => '<h1>Hello</h1>',\n]);\necho $result->requestId;"}]}},"/v1/templates/{id}":{"delete":{"operationId":"templates._id_.delete","summary":"Delete a template","description":"Delete a template","tags":["Templates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template id."}],"responses":{"204":{"description":"Deleted. No response body."},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"templates.{id}.delete","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X DELETE \"$DAVIX_H2I_URL/v1/templates/00000000-0000-4000-8000-000000000000\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.templates.delete({\n    \"id\": \"00000000-0000-4000-8000-000000000000\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->templates()->delete([\n    'id' => '00000000-0000-4000-8000-000000000000',\n]);\necho $result->requestId;"}]},"get":{"operationId":"templates._id_","summary":"Get a template","description":"Get a template","tags":["Templates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template id."}],"responses":{"200":{"description":"The template with its html, css and variables.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Template"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired","not_found"],"x-davix-h2i-id":"templates.{id}","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/templates/00000000-0000-4000-8000-000000000000\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.templates.get({\n    \"id\": \"00000000-0000-4000-8000-000000000000\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->templates()->get([\n    'id' => '00000000-0000-4000-8000-000000000000',\n]);\necho $result->requestId;"}]},"put":{"operationId":"templates._id_.put","summary":"Update a template","description":"Change a template. There is no versioning: the next request that uses the id gets the updated content. Details given for a variable survive as long as the text still uses its name.","tags":["Templates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template id."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"New name (1-100 characters)."},"description":{"type":"string","maxLength":300,"description":"New note (up to 300 characters)."},"html":{"type":"string","description":"The new document."},"css":{"type":"string","description":"The new CSS."},"variables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"A variable the text uses, e.g. customer_name or customer.name."},"default":{"type":"string","description":"Used when a request leaves this variable empty."},"required":{"type":"boolean","description":"When true, a request that leaves it empty (and no default) is refused."},"description":{"type":"string","maxLength":200,"description":"A note for whoever uses the template."}},"required":["name"]},"description":"Details of the variables the html and css use. The variables themselves are found automatically from {{name}} placeholders; list one here only to give it a default, mark it required or describe it. A name the text does not use is refused."}}}}}},"responses":{"200":{"description":"The updated template.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Template"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","duplicate_template_name","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","not_found"],"x-davix-h2i-id":"templates.{id}.put","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X PUT \"$DAVIX_H2I_URL/v1/templates/00000000-0000-4000-8000-000000000000\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"x\",\"description\":\"example\"}'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.templates.update({\n    \"id\": \"00000000-0000-4000-8000-000000000000\",\n    \"name\": \"x\",\n    \"description\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->templates()->update([\n    'id' => '00000000-0000-4000-8000-000000000000',\n    'name' => 'x',\n    'description' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/templates/{id}/file":{"put":{"operationId":"templates._id_.file.put","summary":"Replace the file of a DOCX / ODT template","description":"Upload a new DOCX or ODT file for an existing file template. Details already given for a variable survive as long as the new file still uses its name.","tags":["Templates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template id."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The new DOCX or ODT template.","x-davix-h2i-file":{"note":"At most 4 MB, and never more than your plan allows for a template."}},"variables":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true},"description":"Details of the variables (default, required, description) as a JSON array; omitted = keep the details already saved.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/templates/variable-spec.js"}}},"required":["file"]},"encoding":{"variables":{"contentType":"application/json"}}}}},"responses":{"200":{"description":"The updated template.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Template"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","file_too_large","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field","not_found"],"x-davix-h2i-uploads":{"accepts":true,"shape":"plain","field":"file","minFiles":1,"ceiling":1,"directFiles":1,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"templates.{id}.file.put","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests","files_per_request","upload_mb_per_request","max_file_size_bytes"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X PUT \"$DAVIX_H2I_URL/v1/templates/00000000-0000-4000-8000-000000000000/file\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'file=@document.pdf' \\\n  -F 'variables=[{}]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.templates.file({\n    \"id\": \"00000000-0000-4000-8000-000000000000\",\n    \"file\": 'document.pdf',\n    \"variables\": [\n      {}\n    ]\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->templates()->file([\n    'id' => '00000000-0000-4000-8000-000000000000',\n    'file' => 'document.pdf',\n    'variables' => [[\n\n        ]],\n]);\necho $result->requestId;"}]}},"/v1/templates/upload":{"post":{"operationId":"templates.upload","summary":"Create a DOCX / ODT template","description":"Save a Word (DOCX) or OpenDocument (ODT) file with {{variables}} to fill with POST /v1/documents/mail-merge and templateId. The variables are found in the text of the document (headers, footers and footnotes included).","tags":["Templates"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Template name (1-100 characters after trimming); unique per account.","x-davix-h2i-behavior":{"onOutOfRange":"reject","onInvalid":"reject","normalization":"trimmed","note":"Duplicate name -> 409 duplicate_template_name.","evidence":"src/processing/templates/service.js:validateName"}},"description":{"type":"string","maxLength":300,"description":"A short note about the template (up to 300 characters).","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/templates/service.js:validateDescription"}},"file":{"type":"string","format":"binary","description":"The DOCX or ODT template. Macro-enabled and oversized packages are refused (400).","x-davix-h2i-file":{"note":"At most 4 MB, and never more than your plan allows for a template (largest template)."}},"variables":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true},"description":"Details of the variables the document uses (default, required, description), as a JSON array of { name, default, required, description }. The variables themselves are found automatically.","x-davix-h2i-behavior":{"onInvalid":"reject","evidence":"src/processing/templates/variable-spec.js"}}},"required":["name","file"]},"encoding":{"variables":{"contentType":"application/json"}}}}},"responses":{"201":{"description":"The created template, with the variables found in the document.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Template"}],"type":"object","properties":{"request_id":{"type":"string","description":"Echo of the Request-Id header."}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (for example an Idempotency-Key reused for a different request).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload, page-count or input-size limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","duplicate_template_name","file_too_large","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired","missing_field"],"x-davix-h2i-uploads":{"accepts":true,"shape":"plain","field":"file","minFiles":1,"ceiling":1,"directFiles":1,"multiFile":"native","multipleToggle":false,"either":false},"x-davix-h2i-id":"templates.upload","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests","files_per_request","upload_mb_per_request","max_file_size_bytes"],"jobEligible":false,"studioReachable":true,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X POST \"$DAVIX_H2I_URL/v1/templates/upload\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\" \\\n  -F 'name=x' \\\n  -F 'description=example' \\\n  -F 'file=@document.pdf' \\\n  -F 'variables=[{}]'"},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.templates.upload({\n    \"name\": \"x\",\n    \"description\": \"example\",\n    \"file\": 'document.pdf',\n    \"variables\": [\n      {}\n    ]\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->templates()->upload([\n    'name' => 'x',\n    'description' => 'example',\n    'file' => 'document.pdf',\n    'variables' => [[\n\n        ]],\n]);\necho $result->requestId;"}]}},"/v1/usage":{"get":{"operationId":"usage","summary":"The authenticated customer's own usage: current-period snapshot, per-category totals, recent period history, and (if they have more than one key) a per-key breakdown.","description":"The authenticated customer's own usage: current-period snapshot, per-category totals, recent period history, and (if they have more than one key) a per-key breakdown.","tags":["Usage"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"months","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":24,"default":6,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [1,24]; non-numeric -> 6.","evidence":"src/api/usage/get.js"}},"description":"How many past billing periods to include."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"current":{"$ref":"#/components/schemas/UsageSummary"},"history":{"type":"array","items":{"type":"object"},"description":"Recent plan periods (newest first), summed over all of the customer keys: period, used_files, reserved_files, used_bytes, total_calls, total_files_processed, per-category calls/files, bytes_in, bytes_out, errors, last_request_at."},"by_key":{"type":"array","items":{"type":"object"},"description":"Attribution of the shared quota: one entry per API key of the customer (api_key_id, label, key_prefix or key_last4, period, used_files in the plan unit, by_category, quota_limit, expires_at, expired) plus one Studio entry (studio: true) for the web sign-in keys. A deleted key is not listed; what it used still counts in current and history."},"metered":{"type":"array","items":{"type":"object"},"description":"Plan meters: meter_key, label, unit, used, limit, window_type, window_seconds, match_type, match_value, resets_at."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["current","history","by_key","metered"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","key_expired"],"x-davix-h2i-id":"usage","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/usage?months=6\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.usage.get({\n    \"months\": 6\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->usage()->get([\n    'months' => 6,\n]);\necho $result->requestId;"}]}},"/v1/usage/activity":{"get":{"operationId":"usage.activity","summary":"Use over time and per tool","description":"Use over time and per tool","tags":["Usage"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Another value -> 400 invalid_parameter.","evidence":"src/api/usage/activity.js"}},"description":"today (by hour), 7d, period (the current plan period, by day) or year (12 months). Default 7d."},{"name":"key_id","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Another value -> 400 invalid_parameter.","evidence":"src/api/usage/activity.js"}},"description":"One of your API keys, or \"studio\". Not for year."},{"name":"tz","in":"query","required":false,"schema":{"type":"integer","x-davix-h2i-behavior":{"onInvalid":"fallback","note":"Clamped to -840..840; anything else is UTC.","evidence":"src/platform/quotas/activity/report.js"}},"description":"Your time zone, minutes east of UTC."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"range":{"type":"string","description":"The period asked for."},"unit":{"type":"string","description":"hour, day or month."},"since":{"type":"string","description":"Where the period starts."},"buckets":{"type":"array","items":{"type":"object"},"description":"One per hour, day or month: key, credits, ai_percent (share of your plan's AI), runs, requests, failed, files, tools."},"tools":{"type":"array","items":{"type":"object"},"description":"What each tool used: tool, label, category, credits, ai_percent, requests, failed, files."},"totals":{"type":"object","description":"The same figures for the whole period."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["range","unit","since","buckets","tools","totals"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired"],"x-davix-h2i-id":"usage.activity","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/usage/activity?range=example&key_id=example&tz=1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.usage.activity({\n    \"range\": \"example\",\n    \"key_id\": \"example\",\n    \"tz\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->usage()->activity([\n    'range' => 'example',\n    'key_id' => 'example',\n    'tz' => 1,\n]);\necho $result->requestId;"}]}},"/v1/usage/breakdown":{"get":{"operationId":"usage.breakdown","summary":"Usage activity behind the usage page: per day, per operation, why requests failed, per key, AI cost and jobs, plus what the plan includes","description":"Usage activity behind the usage page: per day, per operation, why requests failed, per key, AI cost and jobs, plus what the plan includes","tags":["Usage"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","enum":["period","7d","30d","month"],"default":"period","x-davix-h2i-enum":"UsageRange","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 invalid_parameter.","evidence":"src/api/usage/breakdown.js"}},"description":"The time window: the current plan period so far (default), the last 7 days, the last 30 days, or the current calendar month (UTC). The previous window of the same length is reported for comparison."},{"name":"key_id","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A key that is not yours -> 400 invalid_parameter.","evidence":"src/api/usage/breakdown.js"}},"description":"Only this API key (an id from the by-key list), or \"studio\" for the web sign-in keys. Omitted = all of your keys, deleted ones included in the totals."},{"name":"key","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"In production any query parameter named key -> 400 api_key_location_not_allowed. Use key_id.","evidence":"server.js"}},"description":"Deprecated name of key_id. Production rejects a query parameter called key (api_key_location_not_allowed), so use key_id."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"window":{"type":"object","description":"range, since, until (the window that was read)."},"days":{"type":"array","items":{"type":"object"},"description":"One entry per UTC day of the window: date, files, requests, errors, by_category. Also ai_percent: the share of your plan's AI that day's AI calls used."},"totals":{"type":"object","description":"files, requests, errors, bytes_in, bytes_out for the window."},"previous":{"type":"object","description":"files, requests, errors for the previous window of the same length."},"operations":{"type":"array","items":{"type":"object"},"description":"Per operation: key (category:operation), label, category, category_label, files, requests, errors, bytes_in, bytes_out, last_used."},"errors":{"type":"array","items":{"type":"object"},"description":"Why requests failed: code, title, hint, count, last_at."},"keys":{"type":"array","items":{"type":"object"},"description":"Per API key: api_key_id, label, files, requests, errors, last_used."},"ai":{"type":"object","nullable":true,"description":"AI calls in the window and percent, the share of your plan's AI they used; null when the plan has no AI or nothing was used."},"requests_last_minute":{"type":"integer"},"plan":{"type":"object","description":"name, slug, is_free, monthly_limit_files (null = unlimited), categories (only those the plan includes: key, label, monthly_limit_files), jobs (allowed, max_active, queue_wait_seconds, active_now), rate_limits, allowance (the plan's allowance: total, shared pool, and how each kind of work draws from it; AI with a budget of its own is shown as a percentage), detail_retention_days."},"jobs":{"type":"object","nullable":true,"description":"Jobs of the last 30 days by status; null when the plan does not allow jobs."},"notifications":{"type":"array","items":{"type":"object"},"description":"The notification preferences (same entries as GET /v1/notifications/preferences)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["window","days","totals","previous","operations","errors","keys","requests_last_minute","plan","notifications"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired"],"x-davix-h2i-id":"usage.breakdown","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/usage/breakdown?range=period&key_id=example&key=example\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.usage.breakdown({\n    \"range\": \"period\",\n    \"key_id\": \"example\",\n    \"key\": \"example\"\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->usage()->breakdown([\n    'range' => 'period',\n    'key_id' => 'example',\n    'key' => 'example',\n]);\necho $result->requestId;"}]}},"/v1/usage/calls":{"get":{"operationId":"usage.calls","summary":"Request log of your keys (time, status, request id, key, operation, size, and the reason for a failure), optionally of one operation","description":"Request log of your keys (time, status, request id, key, operation, size, and the reason for a failure), optionally of one operation","tags":["Usage"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"operation","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"An unknown category -> 400 invalid_parameter.","evidence":"src/api/usage/breakdown.js"}},"description":"Only this operation as listed by /v1/usage/breakdown: \"category:operation\", for example \"image:resize\". Omitted = every request of the window."},{"name":"key_id","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"A key that is not yours -> 400 invalid_parameter.","evidence":"src/api/usage/breakdown.js"}},"description":"Only this API key (an id), or \"studio\". Omitted = all of your keys."},{"name":"key","in":"query","required":false,"schema":{"type":"string","x-davix-h2i-behavior":{"onInvalid":"reject","note":"In production any query parameter named key -> 400 api_key_location_not_allowed. Use key_id.","evidence":"server.js"}},"description":"Deprecated name of key_id. Production rejects a query parameter called key (api_key_location_not_allowed), so use key_id."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":20,"x-davix-h2i-behavior":{"onOutOfRange":"clamp","onInvalid":"fallback","note":"Clamped to [1,200]; non-numeric -> 20.","evidence":"src/api/usage/breakdown.js"}},"description":"How many requests to return, newest first."},{"name":"range","in":"query","required":false,"schema":{"type":"string","enum":["period","7d","30d","month"],"default":"period","x-davix-h2i-enum":"UsageRange","x-davix-h2i-behavior":{"onInvalid":"reject","note":"Any other value -> 400 invalid_parameter.","evidence":"src/api/usage/breakdown.js"}},"description":"The time window of the log: the current plan period so far (default), the last 7 days, the last 30 days, or the current calendar month (UTC)."},{"name":"before","in":"query","required":false,"schema":{"type":"integer","minimum":1,"x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a positive whole number -> 400 invalid_parameter.","evidence":"src/api/usage/breakdown.js"}},"description":"Paging: the next_before of the previous page. Returns the requests older than that one."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"x-davix-h2i-behavior":{"onInvalid":"reject","note":"Not a whole number from 1 -> 400 invalid_parameter.","evidence":"src/api/usage/breakdown.js"}},"description":"Page number (1 = the newest requests). Ignored when `before` is given."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","nullable":true},"total":{"type":"integer","description":"Every request of the window (and operation), not only this page."},"next_before":{"type":"integer","nullable":true,"description":"Pass as before to get the next page; null on the last page."},"calls":{"type":"array","items":{"type":"object"},"description":"Newest first: id, at, status, request_id, key, operation (key, label, category, category_label), files, bytes_in, bytes_out, app, ip, user_agent and, for a failure, error (code, title, hint, message)."},"request_id":{"type":"string","description":"Echo of the Request-Id header."}},"required":["total","calls"]}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: plan/entitlement/key type does not allow this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server busy, timed out or limits temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-davix-h2i-errors":["api_key_location_not_allowed","forbidden","internal_error","invalid_api_key","invalid_parameter","key_expired"],"x-davix-h2i-id":"usage.calls","x-davix-h2i-audience":"customer","x-davix-h2i-platform":{"quotaBucket":null,"rateLimitCategory":null,"supportedMetrics":["requests"],"jobEligible":false,"studioReachable":false,"demoVisible":false},"x-codeSamples":[{"lang":"Shell","label":"cURL","source":"curl -X GET \"$DAVIX_H2I_URL/v1/usage/calls?limit=20&range=period&before=1\" \\\n  -H \"X-Api-Key: $DAVIX_H2I_API_KEY\""},{"lang":"JavaScript","label":"Node.js","source":"const { DavixH2I } = require('@davixlabs/h2i-sdk');\n\nconst h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });\nconst result = await h2i.usage.calls({\n    \"limit\": 20,\n    \"range\": \"period\",\n    \"before\": 1\n  });\nconsole.log(result.data, result.requestId);"},{"lang":"PHP","label":"PHP","source":"<?php\nrequire 'vendor/autoload.php';\n\n$h2i = new \\Davix\\H2I\\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);\n$result = $h2i->usage()->calls([\n    'limit' => 20,\n    'range' => 'period',\n    'before' => 1,\n]);\necho $result->requestId;"}]}}}}