---
title: "Retrieve web-elements JSON from a completed async HTML→PDF job"
method: POST
path: "/api2/webelements"
tags: ["Web Elements"]
---

# Retrieve web-elements JSON from a completed async HTML→PDF job

`POST /api2/webelements`

For HTML→PDF jobs submitted with `async=true` AND `pdf_web_elements_selectors`
set, the matched element positions are stored alongside the produced PDF.
Use this endpoint to fetch them as a JSON array after the job completes.

Synchronous HTML→PDF requests instead receive web elements inline via the
`X-SelectPdf-Web-Elements` response header (base64-encoded JSON, possibly
chunked across `*-Header-N` headers).

## Request body

- WebElementsParameters
  - `key` string, uuid, required
  - `job_id` string, uuid, required — Job UUID of a completed async HTML→PDF call that supplied `pdf_web_elements_selectors`.

## Response `200`

JSON array of matched elements with bounding boxes.

- WebElement[]
  - `selector` string — The CSS selector that matched this element.
  - `page` integer — 1-based page number on which the element appears.
  - `x` number, float
  - `y` number, float
  - `width` number, float
  - `height` number, float
  - `text` string — Text content of the matched element (may be empty for non-text elements).
  - `attributes` object — HTML attributes on the matched element.

## Other responses

- `400` — Bad request — invalid `job_id`.
- `401` — Unauthorized.
- `499` — Job not found, not yet complete, or web-elements file already cleaned up.

---

[API](https://skmtc.dev/selectpdf/apis/selectpdf-rest-api.md) · [All operations](https://skmtc.dev/selectpdf/apis/selectpdf-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/selectpdf/selectpdf-rest-api/revisions/3e8de86ac045/schema)
