Errors
Every error of the API has the same shape, whatever its cause:
{"error": {"code": "scope_missing", "message": "…", "detail": {"required_scope": "jobs:write"}}}
codeis stable and in English: decide on it in your program. Within/v1codes are added, never removed or given a new meaning.messageis written for a person, in the language of theAccept-Languageheader among the languages the service speaks (English otherwise). Do not parse it.detailis always an object, possibly empty: the invalid fields, the missing scope.
An unexpected failure of the service is answered with 500 and server_error. The response never contains the raw error of the service or of a third-party provider.
Codes
| Status | Code | Meaning |
|---|---|---|
400 | bad_request | The request is not valid. |
400 | parse_error | The body is not readable JSON. |
400 | validation_error | Some fields are not valid; detail lists them. |
400 | job_too_long | Pages times the pause exceeds the maximum duration of a job; detail carries the figures (pages, delay_seconds, estimated_seconds, max_seconds). |
400 | invalid_cursor | The pagination cursor is not valid. |
400 | idempotency_key_invalid | Idempotency-Key must be 1 to 255 printable ASCII characters. |
401 | not_authenticated | The API key is missing. |
401 | api_key_invalid | The API key is not valid. |
401 | api_key_revoked | The API key has been revoked. |
401 | api_key_expired | The API key has expired. |
401 | account_deactivated | The account is paused: the key works again when the account is reactivated. |
402 | quota_exceeded | A quota of the plan is used up; nothing was started. For jobs detail.unit says which (browser_minutes, archived_bytes). See Limits and quotas. |
403 | account_inactive | The account is suspended or being deleted. |
403 | permission_denied | The operation is not allowed. |
403 | scope_missing | The key lacks the required scope. |
403 | email_not_verified | The email address of the account has not been verified yet. |
404 | not_found | The object does not exist, or belongs to another customer. |
405 | method_not_allowed | The method is not allowed on this address. |
406 | not_acceptable | The service only answers in JSON. |
409 | idempotency_in_progress | A request with the same Idempotency-Key is still running. |
413 | request_too_large | The request is too large. |
415 | unsupported_media_type | The body must be JSON. |
422 | idempotency_key_reused | The Idempotency-Key was already used for a different request. |
429 | throttled | Too many requests; wait for Retry-After seconds. |
429 | too_many_jobs | You already have all the open jobs the plan allows; detail carries open_jobs, max_open_jobs, max_running_jobs, max_waiting_jobs. Try again when a job finishes. |
500 | server_error | An internal error; it has been logged. Try again shortly. |
A few endpoints answer with a code of their own (for example html_not_available, 404, when the HTML of a capture was not kept). The endpoints and their statuses are listed in the API reference.
The lists of your bulk sender
In the mode bulk the notices go to a list of your bulk sender. You choose it with PATCH /v1/notice-settings, field bulk_target, among the lists that GET /v1/notice-settings/provider-lists and GET /v1/notice-settings/provider-lists/{list_id}/segments read from your provider:
PATCH /v1/notice-settings
{"bulk_target": {"list_id": "a1b2c3d4e5", "segment_id": "4821"}}
segment_id is optional; null in place of the object removes the choice. Both identifiers are at most 100 characters, and any other key is refused. Changing the mode or the connection clears bulk_target.
topics (optional) maps each topic to a segment of the same list: a notice that matches a topic goes to the segment of that topic; one that matches none goes to segment_id, or to the whole list. A notice that matches topics of two segments goes to both, once each.
PATCH /v1/notice-settings
{"bulk_target": {"list_id": "a1b2c3d4e5", "segment_id": "4821", "topics": [
{"code": "sport", "kind": "section", "match": "Sport", "segment_id": "4822"},
{"code": "engineers", "kind": "rule", "all": ["engineer"], "none": ["ranking"],
"synonyms": {"engineer": ["technical officer"]}, "segment_id": "4823"}]}}
A topic is an interest, the same as the topics of a list: kind is section, keyword or rule. A rule may have all (words that must all be there), none (words that exclude it), synonyms ({word: [other words]}, for the words of all and none), sections, fields (filters on the extracted fields of the item, applied only when the item has them) and not_expired. Words are matched whole, without case or accents, on the title, the summary and the read text of each new item. At most 50 topics, 20 words per list, 100 characters per word. Every segment_id is checked with your provider like the list.
| Status | Code | Meaning |
|---|---|---|
400 | validation_error | detail.bulk_target says why: a wrong shape, a topic that does not hold, a mode other than bulk, no bulk connection, or a list or segment your provider does not know (checked when the connection is verified; nothing is saved). |
404 | not_found | Segments of a list your provider does not give to your connection. |
409 | no_list_connection | The lists are read only in the mode bulk, with a bulk connection chosen. |
409 | connection_disabled, connection_not_verified | The connection cannot be used now: reactivate or verify it. |
502 | provider_failed | Your provider did not answer; detail.cause is the cause code (for example unreachable, auth_failed), message says it in words. |
With an unverified connection the choice is saved without the check, and status in GET /v1/notice-settings says why the notices wait: {"state": "blocked", "reason": {"code": "connection_unverified", "message": "…"}, "counts": {…}}. state is not_sending (mode customer), blocked or ready.
The language model of the interests
On top of the rules, a language model can say which interests each new item satisfies, and why. You choose it with PATCH /v1/notice-settings, field meaning:
PATCH /v1/notice-settings
{"meaning": {"source": "own", "connection_id": "conn_01J…"}}
source is off (the default: the rules only), service (the Vaicrawl model, which counts the unit llm_items of your plan: when the quota is over, the rules remain) or own (your connection of type language_model). With your own connection, when the provider does not answer the new items wait and the connection becomes failing (connection.failing): never a fallback on the Vaicrawl model. The model receives only the public text of the item and the text of the interests, never your subscribers. A choice that does not fit is a 400 validation_error with detail.meaning.
What to retry
429: wait for the number of seconds inRetry-After, then retry.409 idempotency_in_progress: the first request is still running; retry shortly with the same key.500and network failures: retry with the sameIdempotency-Key(see Idempotency), with an increasing wait.- Any other
4xx: the request itself is wrong; retrying it unchanged gives the same answer.
Not found, not forbidden
An identifier of another customer is answered with 404, never 403: a 403 would confirm that the object exists.