{
    "openapi": "3.1.0",
    "info": {
        "title": "Everscraper API",
        "version": "1.0.0",
        "summary": "Read the datasets of an Everscraper account, keep an exact copy of their tables, read what changed, and create and manage datasets from your own server.",
        "description": "Version 1 lets a site build an exact copy of a dataset's table, keep it exact, and read the news of the dataset (what the change email reports) to forward to its own subscribers. It also lets a site do the whole life of a dataset from its own server: create it, follow it until it is ready, review or skip the choice of sources, add sources, pause it and delete it, with no person using the app.\n\n## How to sync a dataset\n\n1. Call `GET /datasets` to find the dataset's `id`, and `GET /datasets/{id}` for its columns.\n2. Load the table: call `GET /datasets/{id}/rows` without `since`. While `has_more` is true, call again with the `cursor` the last response returned.\n3. Apply each item in order: upsert a row by its `id`, delete the row when `removed` is true, and ignore the removal of a row you do not have. Receiving the same item twice changes nothing.\n4. When `has_more` is false you are caught up. Store that `cursor`. To sync later, call `rows` again with it and apply what comes back the same way. The first load and every later sync are the same loop.\n5. To tell your subscribers what changed, call `GET /datasets/{id}/changes` and keep its own cursor. Do not use `changes` to keep your table: use `rows`.\n\nA cursor is an opaque string. Do not parse it or build one. It only works for the dataset and the endpoint that issued it: another one, or one that cannot be read, answers 400 `invalid_cursor`, and you can always start again without `since`. For `rows`, a walk started again after `invalid_cursor` for a stored cursor is a first load: replace your copy with what it returns instead of applying it over the old copy, which would keep rows removed long ago.\n\nHistory is kept for at least 90 days. Every cursor carries a time: the time its walk began, and for the cursor that ends a walk (`has_more` false), the time of that request, which a later sync starting from it carries too. A cursor whose time is more than 90 days ago answers 410 `cursor_expired`. For `rows`, drop your copy and load from the beginning. For `changes`, call again without `since`; it continues from the oldest change kept and you drop nothing. A sync that finishes within 90 days of the end of the previous one never sees it; one that starts close to that limit can expire before it ends.\n\n## How to create a dataset\n\n1. Call `POST /datasets` with a `brief`, the text the dataset is about. It answers 201 with the dataset, `status` `discovering`, and starts the search for sources. Send an `Idempotency-Key` header so a retry never creates a second dataset.\n2. Follow `GET /datasets/{id}` until `status` leaves `discovering`. With `source_confirmation` `auto` the sources found, and any you added meanwhile, are confirmed for you and the dataset goes to `compiling`, then `ready`; if it ends with no source at all (none found, or the search failed), it is `failed` and `failure_reason` says why. A failed dataset is not retried and takes no added source (409 `invalid_state`): delete it and create it again.\n3. With `source_confirmation` `manual` (the default) the dataset waits at `awaiting_confirmation`. Read the sources with `GET /datasets/{id}/sources`, add more with `POST /datasets/{id}/sources`, and call `POST /datasets/{id}/sources/confirm` to keep the ones you choose and start the build. The dataset goes to `compiling`, then `ready`.\n4. `PATCH /datasets/{id}` pauses and resumes a dataset, and `DELETE /datasets/{id}` deletes it.\n\nA dataset made through the API sends no emails unless `emails` is true: a hundred datasets would mean a hundred emails a day.\n\n## Limits on writing\n\nAn account holds at most 50 datasets that are neither paused nor `failed` (no limit on the `unlimited` plan): creating or resuming one past that answers 429 `dataset_limit_reached`, and waiting does not free it. At most 20 datasets are created a day per account through the API; the 21st in a rolling 24 hours answers 429 `creation_limit_reached` with `Retry-After`. A dataset holds at most 30 sources, candidates included, however they came: past that the answer is 422 `source_limit_reached`, and the search for sources stores no more than the room left. The account's plan limits what it holds, adds and spends, in the app too: creating a dataset with no room for a source, or confirming or adding more sources than the room left, answers 403 `plan_limit_reached`; once the month's spending reaches the plan's limit, creating, confirming and adding answer 403 `spend_cap_reached` until the first of the month (UTC), while refreshes go on. A token of a suspended account answers 403 `account_suspended` on every endpoint. A body is at most 100,000 bytes. A body that is not a JSON object, a field that is wrong or missing and a field the endpoint does not know all answer 422 `invalid_body`, with `errors` naming each field: an unknown field is refused, never ignored.\n\n## Idempotency\n\n`POST /datasets` takes an optional `Idempotency-Key` header of up to 200 characters. The key belongs to the account, not to the token, and to the dataset it created for as long as that dataset exists. The same key with the same body answers 200 with that dataset, as it is now, and creates nothing; with another body it answers 409 `idempotency_conflict`. A key already used is answered before any limit is checked. A header that is empty or only spaces is no key. Deleting the dataset frees its key.\n\n## Webhooks\n\nInstead of asking every few minutes, register an endpoint in Settings, under Webhooks: an HTTPS URL, for all the account's datasets or chosen ones. Everscraper then `POST`s it a small JSON message when something about a dataset changes. There are three events: `dataset.updated` (its rows or changes moved, or its number of failing sources did), `dataset.status_changed` (its `status` took a new value, or it was paused or resumed; carries `status` and `paused`) and `dataset.deleted`. A message is a signal and carries no data: `{ \"id\", \"type\", \"dataset\", \"external_ref\", \"at\" }`. Read this API for the rest. Messages can arrive late, twice (the same `id`) or out of order; a failed delivery is retried for about 24 hours.\n\nEach delivery has the headers `Everscraper-Event` (the event's type) and `Everscraper-Signature: t=<unix seconds>,v1=<hex>`. `v1` is the HMAC-SHA256, in hex, of the text `{t}.{raw body}` (the timestamp, a full stop, and the body exactly as received) with the endpoint's secret, shown once when it was registered. To check a delivery, compute it over the raw body, compare it with `v1` in constant time, and refuse a delivery whose `t` is more than a few minutes old, so a captured message cannot be replayed. Answer with a 2xx within 10 seconds; redirects are not followed.\n\n## Conventions\n\n- JSON with `snake_case` names. Dates are ISO 8601 in UTC with a trailing `Z`.\n- Every ID is a UUID. No response contains a database number.\n- Within v1 changes only add: new fields, new endpoints, new optional parameters. Ignore fields you do not know. Anything else is v2.\n- Every response carries a `Cache-Control` header with the `no-store` directive. The API sends no CORS headers: it is for servers, not browsers.\n- Errors are problem-details documents (RFC 9457, `application/problem+json`). Branch on `code`, never on `detail`.\n\n## Access and limits\n\nSend a personal access token as `Authorization: Bearer evs_...`. A user creates tokens in Settings, under API tokens. A token is shown once and never expires. It has the ability `read`, or `read` and `write`: every endpoint that reads needs `read`, and every endpoint that writes (`POST`, `PATCH` and `DELETE`) needs `write` too. A token reads, and with `write` changes, every dataset of its account and no other. Writing also needs the account's email to be verified: a token outlives a change of email, and until the new address is confirmed every endpoint that writes answers 403 `forbidden`. A browser session is not accepted.\n\nA token may make 120 requests a minute, reads and writes together. Requests without a valid token are limited by address, and so is this document. Over the limit the answer is 429 with a `Retry-After` header holding the seconds to wait."
    },
    "servers": [
        {
            "url": "https://api.everscraper.com/v1",
            "description": "Version 1 of the API."
        }
    ],
    "security": [
        {
            "bearerAuth": ["read"]
        }
    ],
    "paths": {
        "/datasets": {
            "get": {
                "operationId": "listDatasets",
                "summary": "List the account's datasets",
                "description": "Returns every dataset of the token's account, in any status, oldest first. The answer uses the envelope of the paged endpoints (`data` and `has_more`) so paging can be added without breaking anyone. In v1 it returns them all and `has_more` is always false. With `external_ref` it returns only the datasets with that reference.",
                "responses": {
                    "200": {
                        "description": "The account's datasets.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DatasetList"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ExternalRef"
                    }
                ]
            },
            "post": {
                "operationId": "createDataset",
                "summary": "Create a dataset and start discovery",
                "description": "Creates a dataset in the token's account and starts discovery, the search for sources, as the app does when its owner types a prompt. Needs the ability `write`. Only `brief` is required. It answers 201 with the dataset as `GET /datasets/{id}` returns it, with `status` `discovering`.\n\nWith an `Idempotency-Key` that the account already used, it answers 200 with the dataset that key created, as it is now, and creates nothing, as long as the body is the same; with another body, 409 `idempotency_conflict`. A header that is empty or only spaces is no key.\n\nAn account holds at most 50 datasets that are neither paused nor failed, with no limit on the `unlimited` plan (429 `dataset_limit_reached`, which is checked first and does not use up one of the day's creations) and creates at most 20 a day through the API (429 `creation_limit_reached` with `Retry-After`). `emails` is false unless asked for, and `source_confirmation` is `manual` unless asked for.",
                "security": [
                    {
                        "bearerAuth": ["read", "write"]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IdempotencyKey"
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/CreateDataset"
                },
                "responses": {
                    "200": {
                        "description": "The dataset that the `Idempotency-Key` created earlier, as it is now. Nothing was created.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Dataset"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The dataset created, `discovering`.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Dataset"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/IdempotencyConflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/InvalidBody"
                    },
                    "429": {
                        "$ref": "#/components/responses/CreationLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/datasets/{id}": {
            "get": {
                "operationId": "getDataset",
                "summary": "Get one dataset",
                "description": "Returns one dataset with its columns (the scraped ones, then the enriched ones, in the order of the CSV export), its refresh schedule, its row count and its dates. A dataset of another account, an unknown ID and an ID that is not a UUID all answer 404.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The dataset.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Dataset"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            },
            "patch": {
                "operationId": "updateDataset",
                "summary": "Pause, resume or reschedule a dataset",
                "description": "Takes `paused`, `schedule` or both, and answers 200 with the dataset. Needs the ability `write`. Any other field, and a body with neither, is refused with 422 `invalid_body`. The body is applied whole or not at all: a refused schedule or a refused resume changes nothing. A dataset can be paused in any status. While it is paused nothing new that spends is started: no scheduled refresh, no confirmation and no added source; a confirmation or an added source asked for answers 409 `invalid_state`. Work already running finishes. A paused dataset keeps its rows and changes and every read answers as before; `next_refresh_at` is null. Resuming sets the next refresh by the schedule and does not refresh at once; past the limit on active datasets it answers 429 `dataset_limit_reached`. An auto dataset paused while discovering waits at `awaiting_confirmation` and is confirmed when it is resumed. `schedule` replaces the whole schedule, in any status; the next refresh moves to the first time it comes round, and an open refresh goes on. With both fields the schedule is set first. A schedule with more refreshes a day than the account's plan allows answers 403 `plan_limit_reached`.",
                "security": [
                    {
                        "bearerAuth": ["read", "write"]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/UpdateDataset"
                },
                "responses": {
                    "200": {
                        "description": "The dataset, as it is after the change.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Dataset"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/InvalidBody"
                    },
                    "429": {
                        "$ref": "#/components/responses/DatasetLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            },
            "delete": {
                "operationId": "deleteDataset",
                "summary": "Delete a dataset",
                "description": "Deletes the dataset and everything it has, as the app does: sources, rows and history. Needs the ability `write`. It answers 204 with no body, and the dataset then answers 404. It works on any dataset of the account, paused or not. It cannot be undone. The dataset's `Idempotency-Key` is free again.",
                "security": [
                    {
                        "bearerAuth": ["read", "write"]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    }
                ],
                "responses": {
                    "204": {
                        "description": "The dataset is deleted. There is no body.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/datasets/{id}/rows": {
            "get": {
                "operationId": "listRows",
                "summary": "Read the rows written since a cursor",
                "description": "Returns rows, in full, and the removal of rows, in order of position. `data` mixes both: a row has `removed` false, a removed row has `removed` true and only its `id` and `removed_at`. Without `since` the stream starts at the beginning, which is the first load. Call again with the returned `cursor` while `has_more` is true, then keep the cursor for the next sync. A site upserts a row by `id`, deletes on `removed`, and ignores the removal of a row it does not have. This is the endpoint that keeps a copy of the table exact.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    },
                    {
                        "$ref": "#/components/parameters/Since"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of rows and removed rows, and the cursor to continue from.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RowPage"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "410": {
                        "$ref": "#/components/responses/CursorExpired"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/datasets/{id}/rows/{row_id}": {
            "get": {
                "operationId": "getRow",
                "summary": "Get one row",
                "description": "Returns the row with that ID, with every column. A row of another dataset, an ID no row has, an ID that is not a UUID and a row that was removed all answer 404: the marker of a removed row is served by `rows` only.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    },
                    {
                        "$ref": "#/components/parameters/RowId"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The row.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Row"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/datasets/{id}/query": {
            "get": {
                "operationId": "queryRows",
                "summary": "Ask which rows match",
                "description": "Returns the rows that pass every filter and the search, sorted, a page at a time, and how many match in all. It is for asking questions of the table, not for keeping a copy: each page is cut from the table as it is at that moment, so a row written between two pages can come twice or not at all. Keep a copy with `rows`. Filters and sorting name a field: a column of the dataset by its name (`price`), or one of three fields of the row written with `@` in front (`@first_seen_at`, `@updated_at`, `@source`). Duplicates are left out unless `duplicates=include`. A parameter the endpoint does not know answers 400, so a misspelled filter is never ignored. A query that takes more than 5 seconds is stopped and answers 503 `query_timeout`.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    },
                    {
                        "$ref": "#/components/parameters/QueryFilter"
                    },
                    {
                        "$ref": "#/components/parameters/QuerySearch"
                    },
                    {
                        "$ref": "#/components/parameters/QuerySort"
                    },
                    {
                        "$ref": "#/components/parameters/QueryColumns"
                    },
                    {
                        "$ref": "#/components/parameters/QueryDuplicates"
                    },
                    {
                        "$ref": "#/components/parameters/QueryLimit"
                    },
                    {
                        "$ref": "#/components/parameters/QueryOffset"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of the rows that match, and how many match in all.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QueryPage"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidQuery"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    },
                    "503": {
                        "$ref": "#/components/responses/QueryTimeout"
                    }
                }
            }
        },
        "/datasets/{id}/changes": {
            "get": {
                "operationId": "listChanges",
                "summary": "Read the changes (the news) since a cursor or a date",
                "description": "Returns the changes Everscraper stores for the change email and the app, oldest first, each with the ID of the row it is about. Without `since` the feed starts at the oldest change kept; a site that does not want to forward old news does not forward during its first run. With `from` it starts at a moment instead. Paging, cursors and errors work as they do for rows, and the cursor is the endpoint's own. A source's first build and a row's first enrichment answer are not news. This is not how a copy of the table is kept right: use `rows` for that and this endpoint for what to tell subscribers.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    },
                    {
                        "$ref": "#/components/parameters/Since"
                    },
                    {
                        "$ref": "#/components/parameters/From"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of changes, and the cursor to continue from.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChangePage"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "410": {
                        "$ref": "#/components/responses/CursorExpired"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/datasets/{id}/sources": {
            "get": {
                "operationId": "listSources",
                "summary": "List the dataset's sources",
                "description": "Returns every source of the dataset, oldest first, in the envelope of the paged endpoints (`data` and `has_more`; in v1 `has_more` is always false). Needs the ability `read` and answers whatever the dataset's `status`, candidates included.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The dataset's sources.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SourceList"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            },
            "post": {
                "operationId": "addSources",
                "summary": "Add sources by URL",
                "description": "Adds sources to the dataset by URL. Needs the ability `write`. Before the dataset's sources are confirmed they become candidates; after that they are built at once and the dataset goes to `compiling`, as in the app. It answers 201 with `{ \"data\": [...] }`, the sources created, and no `has_more`.\n\nA URL must be a public http or https page, and its domain must not already be a source of the dataset. One bad entry refuses the whole call with 422 `invalid_body`, whose `errors` name the entry, and nothing is added. A dataset holds at most 30 sources, candidates included: a call that would pass it answers 422 `source_limit_reached` and adds nothing. A paused dataset refuses added sources with 409 `invalid_state`. So does a `failed` dataset: it is not retried, so delete it and create it again.",
                "security": [
                    {
                        "bearerAuth": ["read", "write"]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/AddSources"
                },
                "responses": {
                    "201": {
                        "description": "The sources created.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SourcesCreated"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/InvalidState"
                    },
                    "422": {
                        "$ref": "#/components/responses/InvalidBodyOrSourceLimit"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/datasets/{id}/sources/confirm": {
            "post": {
                "operationId": "confirmSources",
                "summary": "Confirm the sources and start the build",
                "description": "Keeps the sources named in `sources`, adds the URLs in `add` as selected sources, deselects the rest and starts the build: the dataset goes to `compiling`. Needs the ability `write`. The two lists hold 1 to 20 entries between them. It works only while the dataset is `awaiting_confirmation`; in any other status, and while the dataset is paused, it answers 409 `invalid_state`, and the detail says which status the dataset is in. A source ID that is not a source of the dataset answers 422 `invalid_body`, with `errors` naming the entry, and so does a URL that is not a public http or https page or whose domain the dataset already has. A dataset holds at most 30 sources: a call that would pass it answers 422 `source_limit_reached` and adds nothing. It answers 200 with the dataset.",
                "security": [
                    {
                        "bearerAuth": ["read", "write"]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/DatasetId"
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/ConfirmSources"
                },
                "responses": {
                    "200": {
                        "description": "The dataset, `compiling`.",
                        "headers": {
                            "Cache-Control": {
                                "$ref": "#/components/headers/CacheControl"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Dataset"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/InvalidState"
                    },
                    "422": {
                        "$ref": "#/components/responses/InvalidBodyOrSourceLimit"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "evs_...",
                "description": "A personal access token, created in Settings under API tokens and shown once. It starts with `evs_`, never expires and is revoked by hand. It has the ability `read`, or `read` and `write`; the endpoints that write need `write` as well. The browser's session is not accepted."
            }
        },
        "parameters": {
            "DatasetId": {
                "name": "id",
                "in": "path",
                "required": true,
                "description": "The dataset's ID: the UUID it has in the app's URLs. An ID that is not a UUID answers 404.",
                "schema": {
                    "type": "string",
                    "format": "uuid"
                }
            },
            "RowId": {
                "name": "row_id",
                "in": "path",
                "required": true,
                "description": "The row's ID, as `rows`, `query` and `changes` give it. An ID that is not a UUID answers 404.",
                "schema": {
                    "type": "string",
                    "format": "uuid"
                }
            },
            "Since": {
                "name": "since",
                "in": "query",
                "required": false,
                "description": "The `cursor` of a previous response of this endpoint for this dataset. An opaque string: pass it back as it came. Leave it out to start at the beginning. A cursor of another dataset or endpoint, or one that cannot be read, answers 400 `invalid_cursor`; one whose time is more than 90 days ago answers 410 `cursor_expired`.",
                "schema": {
                    "type": "string"
                }
            },
            "From": {
                "name": "from",
                "in": "query",
                "required": false,
                "description": "Starts the feed at a moment instead of at the oldest change kept: a day (`2026-11-14`, the start of that day in UTC) or a moment with its zone (`2026-11-14T08:00:00Z`). The response's `cursor` continues the walk. A moment before the oldest change kept starts at the oldest; one in the future answers an empty page and a cursor. Together with `since`, or when it cannot be read, it answers 400 `invalid_parameter`.",
                "schema": {
                    "type": "string"
                }
            },
            "QueryFilter": {
                "name": "filter",
                "in": "query",
                "required": false,
                "style": "deepObject",
                "explode": true,
                "description": "Filters, written `filter[field][operator]=value`, for example `filter[price][lt]=20&filter[city][eq]=girona`. A row must pass them all; up to 10. Operators: `eq` (the value, written as text, is the text given, ignoring case, or both are the same number), `ne` (the opposite of `eq`; rows with no value pass), `lt`, `lte`, `gt`, `gte` (the value is a number below, at or below, above, at or above the number given; a value stored as text never passes, and it is not an error), `contains` (the value, written as text, contains the text, ignoring case) and `null` (`true`: the row has no value; `false`: it has one). `@first_seen_at` and `@updated_at` take `lt`, `lte`, `gt` and `gte` with a day (`2026-11-14`) or a moment with its zone (`2026-11-14T08:00:00Z`). `@source` takes `eq` and `ne` with a source's ID or domain.",
                "schema": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    }
                }
            },
            "QuerySearch": {
                "name": "search",
                "in": "query",
                "required": false,
                "description": "Keeps the rows where at least one value of the dataset's current columns, written as text, contains this text, ignoring case. It reads the letters as written: no word forms, and `cafe` does not find `café`. It looks at every column, whatever `columns` says, and not at the source or `source_url`.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                }
            },
            "QuerySort": {
                "name": "sort",
                "in": "query",
                "required": false,
                "description": "Up to 3 fields separated by commas, each ascending, or descending with `-` in front: `sort=-price,name`. Within a column numbers come first in their order, then texts ignoring case, then false, then true, then lists and objects; rows with no value come last in either direction. Ties, and a query without `sort`, come in the order of the CSV export.",
                "schema": {
                    "type": "string"
                }
            },
            "QueryColumns": {
                "name": "columns",
                "in": "query",
                "required": false,
                "description": "The columns `values` carries, separated by commas: `columns=name,price`. Without it, all of them.",
                "schema": {
                    "type": "string"
                }
            },
            "QueryDuplicates": {
                "name": "duplicates",
                "in": "query",
                "required": false,
                "description": "`include` returns and counts the rows that are a copy of another source's row. Without it they are left out, as in the CSV export.",
                "schema": {
                    "type": "string",
                    "enum": ["include"]
                }
            },
            "QueryLimit": {
                "name": "limit",
                "in": "query",
                "required": false,
                "description": "The most rows to return in one page: a whole number from 1 to 100. Anything else answers 400 `invalid_parameter`.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 20
                }
            },
            "QueryOffset": {
                "name": "offset",
                "in": "query",
                "required": false,
                "description": "How many matching rows to skip before the page. One past the end answers an empty `data` with the `total`.",
                "schema": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 0
                }
            },
            "Limit": {
                "name": "limit",
                "in": "query",
                "required": false,
                "description": "The most items to return in one page: a whole number from 1 to 1,000. Anything else answers 400 `invalid_parameter`.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "default": 500
                }
            },
            "ExternalRef": {
                "name": "external_ref",
                "in": "query",
                "required": false,
                "description": "Returns only the datasets with this `external_ref`, the caller's own reference given at creation. It is not unique, so more than one dataset can match. Text of 1 to 200 characters: an empty value, or a longer one, answers 400 `invalid_parameter`.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                }
            },
            "IdempotencyKey": {
                "name": "Idempotency-Key",
                "in": "header",
                "required": false,
                "description": "A key of up to 200 characters that makes a retry safe. It belongs to the account, not to the token, and to the dataset it created for as long as that dataset exists. The same key with the same body answers 200 with that dataset, as it is now, and creates nothing; the same key with another body answers 409 `idempotency_conflict`. A key already used is answered before any limit is checked. A header that is empty or only spaces is no key, and a key that is not valid UTF-8, or longer than 200 characters, answers 422 `invalid_body`.",
                "schema": {
                    "type": "string",
                    "maxLength": 200
                }
            }
        },
        "headers": {
            "CacheControl": {
                "description": "The value always contains the `no-store` directive and may carry others, for example `private`: the answer is private to the account and changes on every refresh.",
                "schema": {
                    "type": "string"
                }
            },
            "RetryAfter": {
                "description": "The seconds to wait before the next request.",
                "schema": {
                    "type": "integer",
                    "minimum": 0
                }
            }
        },
        "responses": {
            "BadRequest": {
                "description": "A parameter is not valid. `code` is `invalid_parameter` when `limit` is not a whole number from 1 to 1,000 or `external_ref` is empty or longer than 200 characters, and `invalid_cursor` when `since` cannot be read or belongs to another dataset or endpoint. After `invalid_cursor` the site can always start again without `since`.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Bad Request",
                            "status": 400,
                            "code": "invalid_parameter",
                            "detail": "limit must be a whole number from 1 to 1000."
                        }
                    }
                }
            },
            "InvalidQuery": {
                "description": "The query cannot be read. `code` is `invalid_parameter` and the detail names the parameter: a field that is not a column of the dataset (the detail lists its columns), an operator that does not exist or that the field does not take, a value the operator cannot read, too many filters or sort fields, a `search`, `limit` or `offset` out of range, or a parameter the endpoint does not know.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Bad Request",
                            "status": 400,
                            "code": "invalid_parameter",
                            "detail": "There is no column `prize`. The columns are: name, price."
                        }
                    }
                }
            },
            "QueryTimeout": {
                "description": "The query took more than 5 seconds and was stopped. `code` is `query_timeout` and nothing of the result is sent. Narrow the filters or ask for fewer rows.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Service Unavailable",
                            "status": 503,
                            "code": "query_timeout",
                            "detail": "The query took too long. Narrow the filters or ask for fewer rows."
                        }
                    }
                }
            },
            "Unauthenticated": {
                "description": "No token, a bad or revoked token, or only a browser session. Send a valid API token as a bearer token. `code` is `unauthenticated`.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Unauthorized",
                            "status": 401,
                            "code": "unauthenticated",
                            "detail": "Send a valid API token as a bearer token."
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "The token does not have the ability the endpoint needs: `read` for every endpoint, and `write` as well for the ones that write. An endpoint that writes also answers it when the account's email is not verified (it changed and has not been confirmed again). `code` is `forbidden`. Every endpoint answers 403 `account_suspended` for a token of a suspended account. Creating a dataset, confirming sources and adding sources also answer 403 `plan_limit_reached` when the account's plan has no room for the sources, and `spend_cap_reached` when the account spent its plan's limit for the month. Creating a dataset and changing its schedule answer 403 `plan_limit_reached` when the schedule asks for more refreshes a day than the plan allows.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Forbidden",
                            "status": 403,
                            "code": "forbidden",
                            "detail": "The token cannot do this."
                        }
                    }
                }
            },
            "NotFound": {
                "description": "A dataset of another account, a dataset that does not exist, a deleted one, or an ID that is not a UUID: they look the same, so a token cannot tell which datasets exist. `code` is `not_found`.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Not Found",
                            "status": 404,
                            "code": "not_found",
                            "detail": "Nothing here, or nothing this token can see."
                        }
                    }
                }
            },
            "CursorExpired": {
                "description": "The cursor's time is more than 90 days ago, and the removals and changes since may no longer be on record. `code` is `cursor_expired`. For `rows`, drop the copy and load again from the beginning. For `changes`, call again without `since`: it continues from the oldest change kept and nothing is dropped.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Gone",
                            "status": 410,
                            "code": "cursor_expired",
                            "detail": "The cursor is too old. Start again without one."
                        }
                    }
                }
            },
            "ServerError": {
                "description": "An unexpected failure on our side. `code` is `server_error` and the detail says nothing about the cause. Try again later.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Internal Server Error",
                            "status": 500,
                            "code": "server_error",
                            "detail": "Something went wrong on our side."
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "Too many requests: 120 a minute for a token, and a lower limit by address for requests without a valid token. Wait the seconds in `Retry-After`. `code` is `rate_limited`.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    },
                    "Retry-After": {
                        "$ref": "#/components/headers/RetryAfter"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Too Many Requests",
                            "status": 429,
                            "code": "rate_limited",
                            "detail": "Too many requests. Wait for Retry-After seconds."
                        }
                    }
                }
            },
            "InvalidBody": {
                "description": "The body is not valid: it is not a JSON object, a field is wrong or missing, a field the endpoint does not know is present (an unknown field is refused, never ignored), the body is over 100,000 bytes or the `Idempotency-Key` is not valid UTF-8. `code` is `invalid_body`, and `errors` names each field with its message.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/ValidationProblem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Unprocessable Content",
                            "status": 422,
                            "code": "invalid_body",
                            "detail": "The brief must be at least 5 characters.",
                            "errors": {
                                "brief": "The brief must be at least 5 characters."
                            }
                        }
                    }
                }
            },
            "InvalidBodyOrSourceLimit": {
                "description": "Either the body is not valid, or it would take the dataset past 30 sources. `code` `invalid_body`: the body is not a JSON object, a field is wrong, missing or unknown, a URL is not a public http or https page, a URL's domain is already a source of the dataset, or a source ID is not a source of the dataset; one bad entry refuses the whole call and nothing is added, and `errors` names the entry. `code` `source_limit_reached`: a dataset holds at most 30 sources, candidates included, and nothing is added.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/Problem"
                                },
                                {
                                    "$ref": "#/components/schemas/ValidationProblem"
                                }
                            ]
                        }
                    }
                }
            },
            "InvalidState": {
                "description": "The dataset's state does not allow this. `code` is `invalid_state` and the detail says why: confirming sources needs the dataset to be `awaiting_confirmation` (the detail names the status it is in), and a paused dataset refuses a confirmation and added sources.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Conflict",
                            "status": 409,
                            "code": "invalid_state",
                            "detail": "This dataset is paused. Resume it first."
                        }
                    }
                }
            },
            "IdempotencyConflict": {
                "description": "The `Idempotency-Key` was already used, for this account, with a different body. `code` is `idempotency_conflict`. Send the same body to get the dataset the key created, or use a new key.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Conflict",
                            "status": 409,
                            "code": "idempotency_conflict",
                            "detail": "This Idempotency-Key was already used with a different body."
                        }
                    }
                }
            },
            "DatasetLimited": {
                "description": "Either too many requests, or the account is at its plan's limit of datasets that are neither paused nor failed (50 on every plan but `unlimited`). `code` `rate_limited`: wait the seconds in `Retry-After`. `code` `dataset_limit_reached`: resuming this dataset would pass the limit; there is no `Retry-After`, because waiting does not free it: pause or delete another dataset first.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    },
                    "Retry-After": {
                        "$ref": "#/components/headers/RetryAfter"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Too Many Requests",
                            "status": 429,
                            "code": "dataset_limit_reached",
                            "detail": "The account holds 50 datasets that are neither paused nor failed, its limit. Pause or delete one first."
                        }
                    }
                }
            },
            "CreationLimited": {
                "description": "Too many requests, or a limit on creating datasets. `code` `rate_limited`: wait the seconds in `Retry-After`. `code` `dataset_limit_reached`: the account holds 50 datasets that are neither paused nor failed; there is no `Retry-After`, because waiting does not free it: pause or delete one first. `code` `creation_limit_reached`: the account created 20 datasets in a rolling 24 hours through the API and the MCP tools together, deleted ones included; wait the seconds in `Retry-After`, which end that window. A key already used is answered before any limit is checked, so a retry still gets its dataset.",
                "headers": {
                    "Cache-Control": {
                        "$ref": "#/components/headers/CacheControl"
                    },
                    "Retry-After": {
                        "$ref": "#/components/headers/RetryAfter"
                    }
                },
                "content": {
                    "application/problem+json": {
                        "schema": {
                            "$ref": "#/components/schemas/Problem"
                        },
                        "example": {
                            "type": "about:blank",
                            "title": "Too Many Requests",
                            "status": 429,
                            "code": "creation_limit_reached",
                            "detail": "The account has created as many datasets as it may in a day. Try again later."
                        }
                    }
                }
            }
        },
        "schemas": {
            "Dataset": {
                "type": "object",
                "description": "A dataset: a table Everscraper keeps up to date from the sources it scrapes.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The dataset's ID, the UUID it has in the app's URLs."
                    },
                    "name": {
                        "type": "string",
                        "description": "The dataset's name."
                    },
                    "status": {
                        "type": "string",
                        "description": "Where the dataset is in its life: `discovering` (looking for sources), `awaiting_confirmation` (waiting for its sources to be confirmed), `compiling` (building from the sources), `ready` or `failed`. Ignore a value you do not know."
                    },
                    "refreshing": {
                        "type": "boolean",
                        "description": "True while a refresh of the dataset is open: its rows may be changing."
                    },
                    "failing_sources": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "How many of the dataset's selected sources are not updating: their recipe could not be built, or it stopped working and repair gave up."
                    },
                    "brief": {
                        "type": "string",
                        "description": "The text the dataset was created from."
                    },
                    "location": {
                        "type": ["object", "null"],
                        "description": "The object given when the dataset was created, as given, or null."
                    },
                    "external_ref": {
                        "type": ["string", "null"],
                        "description": "The caller's own reference for the dataset, or null."
                    },
                    "source_confirmation": {
                        "type": "string",
                        "description": "Who confirms the sources discovery found: `auto` or `manual`. Ignore a value you do not know."
                    },
                    "paused": {
                        "type": "boolean",
                        "description": "True while the dataset is paused: no scheduled or manual refresh, no confirmation, no added source and nothing else that spends is started. Reading still works. `next_refresh_at` is null while it is."
                    },
                    "emails": {
                        "type": "boolean",
                        "description": "Whether the dataset sends emails: the one that says it is ready and the one that tells of changes. False by default for a dataset created through the API, true for one made in the app."
                    },
                    "sources": {
                        "type": "object",
                        "description": "How many sources the dataset has.",
                        "properties": {
                            "found": {
                                "type": "integer",
                                "minimum": 0,
                                "description": "Every source, candidates included."
                            },
                            "selected": {
                                "type": "integer",
                                "minimum": 0,
                                "description": "The sources confirmed for the dataset."
                            },
                            "ready": {
                                "type": "integer",
                                "minimum": 0,
                                "description": "The selected sources with a working recipe."
                            },
                            "failing": {
                                "type": "integer",
                                "minimum": 0,
                                "description": "The selected sources that are not updating; equals `failing_sources`."
                            }
                        },
                        "required": ["found", "selected", "ready", "failing"]
                    },
                    "failure_reason": {
                        "type": ["string", "null"],
                        "description": "A stable code when the dataset has failed: `no_sources_found` (discovery found none), `search_failed` (the search failed or is not configured), `planning_failed` (no columns were given and none could be planned) or `discovery_failed` (discovery died, for an `auto` dataset). Otherwise null. A failed dataset is not retried: delete it and create it again. Ignore a value you do not know."
                    },
                    "columns": {
                        "type": "array",
                        "description": "The dataset's columns in the order the CSV export uses: the scraped columns, then the enriched ones. The enriched ones include the account's own columns whether or not the model that answers them is configured at the moment.",
                        "items": {
                            "$ref": "#/components/schemas/Column"
                        }
                    },
                    "schedule": {
                        "$ref": "#/components/schemas/Schedule"
                    },
                    "rows": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "How many rows the dataset stores, the duplicates other sources brought included."
                    },
                    "cost": {
                        "$ref": "#/components/schemas/DatasetCost"
                    },
                    "last_refreshed_at": {
                        "type": ["string", "null"],
                        "format": "date-time",
                        "description": "When the dataset was last refreshed, or null if it has not been."
                    },
                    "next_refresh_at": {
                        "type": ["string", "null"],
                        "format": "date-time",
                        "description": "When the dataset is next due to refresh, or null when none is set, as while it is paused."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the dataset was created."
                    }
                },
                "required": [
                    "id",
                    "name",
                    "status",
                    "refreshing",
                    "failing_sources",
                    "brief",
                    "location",
                    "external_ref",
                    "source_confirmation",
                    "paused",
                    "emails",
                    "sources",
                    "failure_reason",
                    "columns",
                    "schedule",
                    "rows",
                    "cost",
                    "last_refreshed_at",
                    "next_refresh_at",
                    "created_at"
                ]
            },
            "DatasetCost": {
                "type": "object",
                "description": "What the dataset has cost, as each of its runs records it. `firecrawl_credits` counts Firecrawl credits only; `usd` is everything, model tokens included, rounded to 4 decimals.",
                "properties": {
                    "last_refresh": {
                        "type": ["object", "null"],
                        "description": "The newest refresh that has closed, on its schedule or by hand: its sources' runs, the repairs they started and its enrichment. Null until a refresh closes after 2026-11-25.",
                        "properties": {
                            "firecrawl_credits": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "usd": { "type": "number", "minimum": 0 }
                        },
                        "required": ["firecrawl_credits", "usd"]
                    },
                    "month": {
                        "type": "object",
                        "description": "Every run of the dataset started in the current calendar month (UTC): discovery, builds, repairs, refreshes and enrichment. The dataset's part of the account's spending a month.",
                        "properties": {
                            "firecrawl_credits": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "usd": { "type": "number", "minimum": 0 }
                        },
                        "required": ["firecrawl_credits", "usd"]
                    }
                },
                "required": ["last_refresh", "month"]
            },
            "Column": {
                "type": "object",
                "description": "One column of a dataset.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The column's name, which is also its key in a row's `values`."
                    },
                    "kind": {
                        "type": "string",
                        "enum": ["scraped", "enriched"],
                        "description": "`scraped` when the column is read from the sources, `enriched` when an enricher adds it."
                    },
                    "description": {
                        "type": ["string", "null"],
                        "description": "What a cell of the column holds, as the dataset was told when it was created; null for a column given as a plain name, one the planner chose, one added in the app, and every enriched column."
                    },
                    "type": {
                        "type": ["string", "null"],
                        "description": "The column's type, or null when it was given none: `text`, `number`, `url` (an http or https address), `list` (up to 100 texts, none empty and none repeated), `enum` (one of `values`) or `date` (the day the source says, as `2026-11-28`, also for a relative date such as `hace 3 días`; the text as written when it cannot be read as a date). A cell of a typed column holds a value of that type or null. Ignore a value you do not know."
                    },
                    "values": {
                        "type": ["array", "null"],
                        "items": {
                            "type": "string"
                        },
                        "description": "The values an `enum` column may hold; null for any other column."
                    }
                },
                "required": ["name", "kind", "description", "type", "values"]
            },
            "Schedule": {
                "type": "object",
                "description": "When the dataset refreshes. The hours and the day are read on the clock of the dataset's timezone. Each refresh starts at the dataset's own minute past the hour, between :00 and :29; `next_refresh_at` carries it.",
                "properties": {
                    "frequency": {
                        "type": "string",
                        "description": "How often the dataset refreshes: `daily` or `weekly` today. Other values may come within v1: ignore a value you do not know."
                    },
                    "weekday": {
                        "type": ["integer", "null"],
                        "minimum": 1,
                        "maximum": 7,
                        "description": "The day of a weekly refresh, from 1 for Monday to 7 for Sunday, or null when the dataset refreshes daily."
                    },
                    "hour": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 23,
                        "description": "The first hour of the day a refresh starts, in the dataset's timezone: the only one for a dataset refreshed once a day or once a week."
                    },
                    "hours": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 23
                        },
                        "description": "Every hour of the day a refresh starts, earliest first, in the dataset's timezone: `[6]` for once a day at 06:00, `[0, 6, 12, 18]` for every six hours. One to 24 hours, with no repeats."
                    },
                    "full_hours": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 23
                        },
                        "description": "The hours whose refresh is full, earliest first; the refreshes at the other hours are quick: they read only the newest records of the sources that have a newest-first address, and remove nothing. Equal to `hours` when every refresh is full."
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The timezone of the schedule, as an IANA name such as `Europe/Madrid`."
                    }
                },
                "required": [
                    "frequency",
                    "weekday",
                    "hour",
                    "hours",
                    "full_hours",
                    "timezone"
                ]
            },
            "DatasetList": {
                "type": "object",
                "description": "The account's datasets in the envelope of the paged endpoints.",
                "properties": {
                    "data": {
                        "type": "array",
                        "description": "Every dataset of the token's account, oldest first.",
                        "items": {
                            "$ref": "#/components/schemas/Dataset"
                        }
                    },
                    "has_more": {
                        "type": "boolean",
                        "description": "Always false in v1: the list returns every dataset. It exists so paging can be added without breaking anyone."
                    }
                },
                "required": ["data", "has_more"]
            },
            "Source": {
                "type": "object",
                "description": "The source a row or a change came from.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The source's public ID."
                    },
                    "domain": {
                        "type": "string",
                        "description": "The source's domain."
                    }
                },
                "required": ["id", "domain"]
            },
            "Row": {
                "type": "object",
                "description": "A row as a site stores it. Upsert it by `id`.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The row's ID, derived from its source and the record's key: the same record in the same source always has the same ID, even if it disappears and comes back."
                    },
                    "removed": {
                        "type": "boolean",
                        "const": false,
                        "description": "Always false for a row. It tells a row from a removed row."
                    },
                    "values": {
                        "type": "object",
                        "description": "The row's data: one key per column of the dataset as it is now, scraped and enriched, with real JSON types. A column with no value is null. When a scraped and an enriched column share a name, the scraped value wins.",
                        "additionalProperties": true
                    },
                    "source": {
                        "$ref": "#/components/schemas/Source"
                    },
                    "source_url": {
                        "type": ["string", "null"],
                        "description": "The record's own page when its source links each record to one, otherwise the page the record was read from; null when there is none."
                    },
                    "duplicate_of": {
                        "type": ["string", "null"],
                        "format": "uuid",
                        "description": "The ID of the row shown in this one's place when another source has the same record, or null. Duplicates are returned and flagged: hide them if you want."
                    },
                    "first_seen_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the row was first stored."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the row last moved forward: it was created, a scraped or enriched value changed, its `source_url` or `duplicate_of` changed, or the dataset's columns changed. A new row has the time it was created. It is not the time the scraped data last changed."
                    }
                },
                "required": [
                    "id",
                    "removed",
                    "values",
                    "source",
                    "source_url",
                    "duplicate_of",
                    "first_seen_at",
                    "updated_at"
                ]
            },
            "RemovedRow": {
                "type": "object",
                "description": "A marker that a row was deleted. Delete the row with this `id`, and ignore it if you do not have it. The marker goes when the record is stored again, and markers are kept at least 90 days.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The ID of the row that was removed."
                    },
                    "removed": {
                        "type": "boolean",
                        "const": true,
                        "description": "Always true for a removed row. It tells a removed row from a row."
                    },
                    "removed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the row was removed."
                    }
                },
                "required": ["id", "removed", "removed_at"]
            },
            "QueryPage": {
                "type": "object",
                "description": "A page of the rows that match a query.",
                "properties": {
                    "data": {
                        "type": "array",
                        "description": "The rows of this page, in the order asked for. `values` carries the columns asked for, or all of them.",
                        "items": {
                            "$ref": "#/components/schemas/Row"
                        }
                    },
                    "total": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "How many rows pass the filters and the search, whatever `limit` and `offset` are. Duplicates count only with `duplicates=include`."
                    },
                    "has_more": {
                        "type": "boolean",
                        "description": "True when rows remain after this page: ask again with a higher `offset`."
                    }
                },
                "required": ["data", "total", "has_more"]
            },
            "RowPage": {
                "type": "object",
                "description": "A page of the rows stream.",
                "properties": {
                    "data": {
                        "type": "array",
                        "description": "Rows and removed rows, in order of position.",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/Row"
                                },
                                {
                                    "$ref": "#/components/schemas/RemovedRow"
                                }
                            ]
                        }
                    },
                    "cursor": {
                        "type": "string",
                        "description": "An opaque string that marks where this page ends. Pass it as `since` to read what comes next. Keep the one from the page whose `has_more` is false for the next sync."
                    },
                    "has_more": {
                        "type": "boolean",
                        "description": "True when there is more to read right now: call again with `cursor`. False when you are caught up."
                    }
                },
                "required": ["data", "cursor", "has_more"]
            },
            "Change": {
                "type": "object",
                "description": "One piece of news: a row was added, changed or removed by a refresh or a repair. Each change has an ID of its own, so whoever receives one twice can tell.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The change's own ID."
                    },
                    "type": {
                        "type": "string",
                        "enum": ["added", "changed", "removed"],
                        "description": "What happened to the row."
                    },
                    "row_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The ID of the row the change is about, the same one `rows` uses."
                    },
                    "label": {
                        "type": ["string", "null"],
                        "description": "A short name for the row, for a message: the record's `name`, or its URL when it has none, cut at 250 characters. An empty string when the record has neither."
                    },
                    "source": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Source"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The source the change came from, or null when that source no longer exists."
                    },
                    "source_url": {
                        "type": ["string", "null"],
                        "description": "The record's own page when its source links each record to one, otherwise the page the record was read from; null when there is none."
                    },
                    "before": {
                        "type": ["object", "null"],
                        "additionalProperties": true,
                        "description": "What was stored before, keyed by column: the changed columns for `changed`, the whole record for `removed`, null for `added`."
                    },
                    "after": {
                        "type": ["object", "null"],
                        "additionalProperties": true,
                        "description": "What is stored now, keyed by column: the changed columns for `changed`, the whole record for `added`, null for `removed`."
                    },
                    "reidentified": {
                        "type": "boolean",
                        "description": "True when the run replaced every record of its source with new keys at once, so the records are probably the same ones under new IDs and a site can skip forwarding them. `rows` stays correct either way."
                    },
                    "at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the change was recorded."
                    }
                },
                "required": [
                    "id",
                    "type",
                    "row_id",
                    "label",
                    "source",
                    "source_url",
                    "before",
                    "after",
                    "reidentified",
                    "at"
                ]
            },
            "ChangePage": {
                "type": "object",
                "description": "A page of the changes feed.",
                "properties": {
                    "data": {
                        "type": "array",
                        "description": "Changes, oldest first. Only changes that have a row ID are served.",
                        "items": {
                            "$ref": "#/components/schemas/Change"
                        }
                    },
                    "cursor": {
                        "type": "string",
                        "description": "An opaque string that marks where this page ends. Pass it as `since` to read what comes next. It belongs to this endpoint and cannot be used for `rows`."
                    },
                    "has_more": {
                        "type": "boolean",
                        "description": "True when there is more to read right now: call again with `cursor`. False when you are caught up."
                    }
                },
                "required": ["data", "cursor", "has_more"]
            },
            "Problem": {
                "type": "object",
                "description": "An error, as a problem-details document (RFC 9457, `application/problem+json`). Branch on `code`, which is stable, never on `detail`.",
                "properties": {
                    "type": {
                        "type": "string",
                        "description": "Always `about:blank`: the status and the code say what went wrong."
                    },
                    "title": {
                        "type": "string",
                        "description": "The standard name of the HTTP status."
                    },
                    "status": {
                        "type": "integer",
                        "description": "The HTTP status, repeated."
                    },
                    "code": {
                        "type": "string",
                        "description": "A stable code. `unauthenticated` (401): no valid token. `forbidden` (403): the token lacks the ability the endpoint needs: `read`, or `write` for the endpoints that write. `not_found` (404): no such dataset, row or source, for this token. `invalid_parameter` (400): a parameter cannot be read or is out of range; the detail names it. `invalid_body` (422): the body of a write is not valid; `errors` names each field. `idempotency_conflict` (409): the `Idempotency-Key` was already used with another body. `invalid_state` (409): the dataset's state does not allow this, for example confirming sources when it is not `awaiting_confirmation`, or any change that spends while it is paused; the detail says why. `dataset_limit_reached` (429): the account holds the most datasets that are neither paused nor failed; waiting does not free it, so there is no `Retry-After`. `creation_limit_reached` (429): the account created the most datasets it may in a day; wait `Retry-After` seconds. `source_limit_reached` (422): the dataset would hold more than 30 sources. `plan_limit_reached` (403): the account's plan has no room for the sources (held, or new this month). `spend_cap_reached` (403): the account spent its plan's limit for the month; it resets on the first of the month (UTC). `account_suspended` (403): the token's account is suspended. `invalid_cursor` (400): `since` cannot be read or belongs to another dataset or endpoint. `cursor_expired` (410): the cursor's time is more than 90 days ago. `rate_limited` (429): too many requests, wait `Retry-After` seconds. `query_timeout` (503): a query took more than 5 seconds and was stopped. `server_error` (500): an unexpected failure on our side, with a fixed detail that says nothing about the cause. Any other HTTP error carries a code named after its status, for example `method_not_allowed` (405): ignore a code you do not know."
                    },
                    "detail": {
                        "type": "string",
                        "description": "A sentence that says what went wrong. For a person to read: it can change."
                    }
                },
                "required": ["type", "title", "status", "code", "detail"]
            },
            "DatasetSource": {
                "type": "object",
                "description": "A source of a dataset: a page Everscraper reads records from.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The source's public ID, the one a row's `source.id` carries."
                    },
                    "url": {
                        "type": "string",
                        "description": "The page the source reads."
                    },
                    "domain": {
                        "type": "string",
                        "description": "The source's domain."
                    },
                    "title": {
                        "type": ["string", "null"],
                        "description": "The page's title, or null when discovery found none."
                    },
                    "kind": {
                        "type": ["string", "null"],
                        "description": "`listing` (a page of many records), `single` (the site or page of one record) or null when it is not known. Everscraper tells a listing from the site of one record, and nothing finer. Ignore a value you do not know."
                    },
                    "listed_count": {
                        "type": ["integer", "null"],
                        "minimum": 0,
                        "description": "How many records discovery found the page lists, or null when it did not count."
                    },
                    "suggested": {
                        "type": "boolean",
                        "description": "True when Everscraper would pre-tick the source in the app: a candidate that is still selected."
                    },
                    "selected": {
                        "type": "boolean",
                        "description": "True when the source is confirmed for the dataset."
                    },
                    "status": {
                        "type": "string",
                        "description": "`candidate` (found, not confirmed), `pending` (confirmed, waiting to be built), `compiling` (being built), `active` (built and updating), `failed` (it could not be built) or `broken` (it stopped working and repair gave up). Ignore a value you do not know."
                    },
                    "rows": {
                        "type": ["integer", "null"],
                        "minimum": 0,
                        "description": "How many rows the source's last full run brought, or null when it has had none. A quick run does not change it."
                    },
                    "quick": {
                        "type": "boolean",
                        "description": "True when the source's recipe has newest-first addresses, which its quick refreshes read; false for a source read whole at every refresh, and for one not built yet."
                    },
                    "error": {
                        "type": ["string", "null"],
                        "description": "Why the source is `failed` or `broken`, or why the last refresh of an `active` source did not go through, in a sentence or two for a person; null when there is nothing to tell. Its wording can change: decide by `error_code`."
                    },
                    "error_code": {
                        "type": ["string", "null"],
                        "description": "A stable code for `error`, null when `error` is: `validation_failed` (its rows did not match an independent reading of the page), `no_data` (no recipe that brings rows), `model_busy` (the model that writes recipes kept turning the work away), `credit_exhausted` (the account Everscraper pays the model with could not pay; a repair is tried again at the next refresh, and a build once the model answers again), `interrupted` (the work was cut short), `unreachable` (the site did not answer on the last refresh; the next one tries again), `repair_gave_up` (it stopped working and repair gave up), `spend_cap_reached` (a repair waits until the account is under its month's spending limit) or `internal_error` (a failure of Everscraper's own). For `model_busy`, `credit_exhausted`, `interrupted` and `internal_error`, `error` is a fixed sentence. Treat a code you do not know as `internal_error`."
                    }
                },
                "required": [
                    "id",
                    "url",
                    "domain",
                    "title",
                    "kind",
                    "listed_count",
                    "suggested",
                    "selected",
                    "status",
                    "rows",
                    "quick",
                    "error",
                    "error_code"
                ]
            },
            "SourceList": {
                "type": "object",
                "description": "The dataset's sources in the envelope of the paged endpoints.",
                "properties": {
                    "data": {
                        "type": "array",
                        "description": "Every source of the dataset, oldest first.",
                        "items": {
                            "$ref": "#/components/schemas/DatasetSource"
                        }
                    },
                    "has_more": {
                        "type": "boolean",
                        "description": "Always false in v1: the list returns every source. It exists so paging can be added without breaking anyone."
                    }
                },
                "required": ["data", "has_more"]
            },
            "SourcesCreated": {
                "type": "object",
                "description": "The sources a call added.",
                "properties": {
                    "data": {
                        "type": "array",
                        "description": "The sources created, in the order of the URLs given. There is no `has_more`: this is not a page.",
                        "items": {
                            "$ref": "#/components/schemas/DatasetSource"
                        }
                    }
                },
                "required": ["data"]
            },
            "ValidationProblem": {
                "type": "object",
                "description": "An error that names fields: a problem-details document with `errors`. Branch on `code`, never on `detail`.",
                "properties": {
                    "type": {
                        "type": "string",
                        "description": "Always `about:blank`: the status and the code say what went wrong."
                    },
                    "title": {
                        "type": "string",
                        "description": "The standard name of the HTTP status."
                    },
                    "status": {
                        "type": "integer",
                        "description": "The HTTP status, repeated."
                    },
                    "code": {
                        "type": "string",
                        "description": "`invalid_body` (422): the body is not valid."
                    },
                    "detail": {
                        "type": "string",
                        "description": "A sentence that says what went wrong. For a person to read: it can change."
                    },
                    "errors": {
                        "type": "object",
                        "description": "Each field that is wrong, by name (`brief`, `schedule.hour`, `urls.1`, `sources.0`), with its message. Always an object. A body that is not a JSON object names `body`.",
                        "additionalProperties": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "type",
                    "title",
                    "status",
                    "code",
                    "detail",
                    "errors"
                ]
            }
        },
        "requestBodies": {
            "CreateDataset": {
                "required": true,
                "description": "The dataset to create. Only `brief` is required. The body is at most 100,000 bytes and is checked whole: a field the endpoint does not know is refused, inside `schedule` too. An empty list `[]` is taken for an empty object.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": ["brief"],
                            "properties": {
                                "brief": {
                                    "type": "string",
                                    "minLength": 5,
                                    "maxLength": 500,
                                    "description": "What the dataset is about, 5 to 500 characters (not counting surrounding spaces), as the app's prompt."
                                },
                                "name": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 100,
                                    "description": "The dataset's name. By default the start of the brief, as in the app."
                                },
                                "location": {
                                    "type": "object",
                                    "maxProperties": 10,
                                    "propertyNames": {
                                        "pattern": "^[a-z][a-z0-9_]{0,30}$"
                                    },
                                    "additionalProperties": {
                                        "type": ["string", "null"],
                                        "maxLength": 100
                                    },
                                    "description": "A flat object of up to 10 values under snake_case keys, each a text of at most 100 characters or null. Its non-null values are added to the text discovery searches with, and read with the brief to decide the country and language the dataset is searched and read for. It is stored and returned as given."
                                },
                                "columns": {
                                    "type": "array",
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "items": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^[a-z][a-z0-9_]{0,30}$",
                                                "description": "The column's name: a lowercase letter, then lowercase letters, digits or underscores, 31 characters at most."
                                            },
                                            {
                                                "type": "object",
                                                "additionalProperties": false,
                                                "description": "A column that also says what it holds. With nothing but a `name` it means what the name alone means.",
                                                "properties": {
                                                    "name": {
                                                        "type": "string",
                                                        "pattern": "^[a-z][a-z0-9_]{0,30}$",
                                                        "description": "The column's name: a lowercase letter, then lowercase letters, digits or underscores, 31 characters at most."
                                                    },
                                                    "description": {
                                                        "type": "string",
                                                        "minLength": 1,
                                                        "maxLength": 300,
                                                        "description": "What a cell of the column holds, in plain words, and what it does not. It is read by the agent that writes each source's recipe and by the reading its recipe is checked against."
                                                    },
                                                    "type": {
                                                        "type": "string",
                                                        "enum": [
                                                            "text",
                                                            "number",
                                                            "url",
                                                            "list",
                                                            "enum",
                                                            "date"
                                                        ],
                                                        "description": "Every value a run stores in the column is of this type, or null. `url` is an http or https address, `list` up to 100 texts, `enum` one of `values`; `date` is the day the source says, as `2026-11-28`, or the text as written when it cannot be read as a date. `name` takes no type but `text`."
                                                    },
                                                    "values": {
                                                        "type": "array",
                                                        "minItems": 2,
                                                        "maxItems": 20,
                                                        "items": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 50
                                                        },
                                                        "description": "What an `enum` column may hold, with no repeats ignoring case. Required with the type `enum`, refused with any other."
                                                    }
                                                },
                                                "required": ["name"]
                                            }
                                        ]
                                    },
                                    "description": "The dataset's scraped columns, as names or as objects that also say what each column holds, in any mix and with no repeats. Without it, the planner chooses them. Every dataset has a `name` column: when the list lacks it, it is put first. A dataset has at most 20 columns, `name` included. A list past 20 is refused as a whole. Descriptions and types are fixed when the dataset is created."
                                },
                                "exclude_columns": {
                                    "type": "array",
                                    "maxItems": 20,
                                    "items": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]{0,30}$",
                                        "description": "A lowercase letter, then lowercase letters, digits or underscores: 31 characters at most."
                                    },
                                    "description": "Names the dataset will never have: they cannot be given in `columns`, the planner cannot choose them and they cannot be added later. A name in both lists answers 422, and so does `name`: it cannot be excluded."
                                },
                                "schedule": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "description": "When the dataset refreshes. Without it: daily, 06:00, UTC. A schedule with more refreshes a day than the account's plan allows answers 403 `plan_limit_reached`.",
                                    "properties": {
                                        "frequency": {
                                            "type": "string",
                                            "enum": ["daily", "weekly"],
                                            "description": "How often the dataset refreshes. `daily` by default."
                                        },
                                        "weekday": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 7,
                                            "description": "The day of a weekly refresh, from 1 for Monday to 7 for Sunday. Required when `frequency` is `weekly`."
                                        },
                                        "hour": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 23,
                                            "description": "The hour of the day the refresh starts, in `timezone`. 6 by default. Not with `hours`."
                                        },
                                        "hours": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 23
                                            },
                                            "minItems": 1,
                                            "maxItems": 24,
                                            "uniqueItems": true,
                                            "description": "Several hours of the day, in any order, for a daily schedule that refreshes at each of them: `[0, 6, 12, 18]` is every six hours. Not with `hour`, and not on a weekly schedule."
                                        },
                                        "full_hours": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 23
                                            },
                                            "minItems": 1,
                                            "maxItems": 24,
                                            "uniqueItems": true,
                                            "description": "Of the schedule's hours, those whose refresh is full: `[6]` with every hour in `hours` is a quick refresh every hour and a full one at 06:00. Every one must be among the schedule's hours. Daily only. Without it every refresh is full. Quick refreshes count towards the plan's refreshes a day as full ones do."
                                        },
                                        "timezone": {
                                            "type": "string",
                                            "description": "An IANA timezone name such as `Europe/Madrid`. `UTC` by default."
                                        }
                                    }
                                },
                                "source_confirmation": {
                                    "type": "string",
                                    "enum": ["auto", "manual"],
                                    "default": "manual",
                                    "description": "Who confirms the sources discovery found. `manual` (the default): the dataset waits at `awaiting_confirmation`. `auto`: every candidate discovery kept is confirmed, up to 20, and the dataset goes to `compiling` with no call. The mode that spends on a build must be asked for."
                                },
                                "external_ref": {
                                    "type": "string",
                                    "maxLength": 200,
                                    "description": "Your own reference for the dataset, at most 200 characters. It is not unique: the idempotency key is what prevents doubles. `GET /datasets?external_ref=` finds the datasets that carry it."
                                },
                                "emails": {
                                    "type": "boolean",
                                    "default": false,
                                    "description": "Whether the dataset sends emails: the one that says it is ready and the one that tells of changes. False by default, because a hundred datasets would mean a hundred daily emails."
                                }
                            }
                        }
                    }
                }
            },
            "UpdateDataset": {
                "required": true,
                "description": "`paused`, `schedule` or both. Any other field, and a body with neither, is refused with 422 `invalid_body`.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "paused": {
                                    "type": "boolean",
                                    "description": "`true` pauses the dataset, `false` resumes it."
                                },
                                "schedule": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "description": "The whole new schedule, by the rules of creating a dataset: it replaces the old one, and a field left out takes its default (`timezone` becomes `UTC`), so send every field you want kept. The next refresh moves to the first time it comes round; a paused dataset keeps it for when it is resumed. More refreshes a day than the account's plan allows answers 403 `plan_limit_reached`.",
                                    "properties": {
                                        "frequency": {
                                            "type": "string",
                                            "enum": ["daily", "weekly"],
                                            "description": "How often the dataset refreshes. `daily` by default."
                                        },
                                        "weekday": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 7,
                                            "description": "The day of a weekly refresh, from 1 for Monday to 7 for Sunday. Required when `frequency` is `weekly`."
                                        },
                                        "hour": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 23,
                                            "description": "The hour of the day the refresh starts, in `timezone`. 6 by default. Not with `hours`."
                                        },
                                        "hours": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 23
                                            },
                                            "minItems": 1,
                                            "maxItems": 24,
                                            "uniqueItems": true,
                                            "description": "Several hours of the day, in any order, for a daily schedule that refreshes at each of them: `[0, 6, 12, 18]` is every six hours. Not with `hour`, and not on a weekly schedule."
                                        },
                                        "full_hours": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 23
                                            },
                                            "minItems": 1,
                                            "maxItems": 24,
                                            "uniqueItems": true,
                                            "description": "Of the schedule's hours, those whose refresh is full: `[6]` with every hour in `hours` is a quick refresh every hour and a full one at 06:00. Every one must be among the schedule's hours. Daily only. Without it every refresh is full. Quick refreshes count towards the plan's refreshes a day as full ones do."
                                        },
                                        "timezone": {
                                            "type": "string",
                                            "description": "An IANA timezone name such as `Europe/Madrid`. `UTC` by default."
                                        }
                                    }
                                }
                            },
                            "minProperties": 1
                        }
                    }
                }
            },
            "ConfirmSources": {
                "required": true,
                "description": "The sources to keep and the URLs to add. The two lists hold 1 to 20 entries between them. Unknown fields are refused.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "sources": {
                                    "type": "array",
                                    "maxItems": 20,
                                    "items": {
                                        "type": "string",
                                        "format": "uuid"
                                    },
                                    "description": "The IDs of the dataset's sources to keep. A source that is not named is deselected. An ID that is not a source of the dataset answers 422 `invalid_body`, with `errors` naming the entry (`sources.0`)."
                                },
                                "add": {
                                    "type": "array",
                                    "maxItems": 20,
                                    "items": {
                                        "description": "A source to add: its address, or an object that also gives an address of the same site listing its records newest first, which the build tries for quick refreshes.",
                                        "oneOf": [
                                            { "type": "string" },
                                            {
                                                "type": "object",
                                                "additionalProperties": false,
                                                "required": ["url"],
                                                "properties": {
                                                    "url": {
                                                        "type": "string",
                                                        "description": "The source's address."
                                                    },
                                                    "newest_first_url": {
                                                        "type": "string",
                                                        "description": "An address on the same domain that lists the same records newest first, such as a listing sorted by date of publication."
                                                    }
                                                }
                                            }
                                        ]
                                    },
                                    "description": "URLs to add as selected sources. Each must be a public http or https page whose domain is not already a source of the dataset."
                                }
                            }
                        }
                    }
                }
            },
            "AddSources": {
                "required": true,
                "description": "The URLs to add. Unknown fields are refused.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": ["urls"],
                            "properties": {
                                "urls": {
                                    "type": "array",
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "items": {
                                        "description": "A source to add: its address, or an object that also gives an address of the same site listing its records newest first, which the build tries for quick refreshes.",
                                        "oneOf": [
                                            { "type": "string" },
                                            {
                                                "type": "object",
                                                "additionalProperties": false,
                                                "required": ["url"],
                                                "properties": {
                                                    "url": {
                                                        "type": "string",
                                                        "description": "The source's address."
                                                    },
                                                    "newest_first_url": {
                                                        "type": "string",
                                                        "description": "An address on the same domain that lists the same records newest first, such as a listing sorted by date of publication."
                                                    }
                                                }
                                            }
                                        ]
                                    },
                                    "description": "1 to 20 URLs. Each must be a public http or https page whose domain is not already a source of the dataset. One bad entry refuses the whole call with 422 `invalid_body`, whose `errors` name the entry (`urls.1`), and nothing is added."
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
