Skip to main content
The edge library sends each delivery record here when logsToken is set. A custom sender may use the same contract. Which transport fits your site: delivery logs.
One record, one request

Request

string
required
Bearer followed by your logs token for direct sending. The token travels in this header only: a request with a query string is refused (400).
string
required
application/json. The body is not compressed: a Content-Encoding header is refused (400). A request carrying a Cookie header is refused (403).
object
required
One delivery record per request, as UTF-8 JSON, at most 8 KiB: one flat object with unique field names and only string, boolean or safe-integer values. event is doubleshift_edge; version is 1.x.y, 1.1.1 or later; record_id is a UUID; ts is an ISO 8601 timestamp with a timezone, less than 24 hours from receipt. A body that contains a doubleshift token is refused. A retry sends the same bytes again. The fields: delivery records.

Response codes

Only 202 is a success. The library makes at most one second attempt, 2 s after the first, and only after a 503, a timeout (10 s) or a network error; every other failure ends in a beacon_failed diagnostic with the HTTP status, or the error when no response came.
accepted
The record is stored, or was already stored.
refused
The request or the record is refused; error names why: query_refused, bad_encoding, bad_content_type, bad_json, bad_version, no_record_id, ts_out_of_window, and others.
refused
The token is missing, malformed, unknown or revoked.
refused
A Cookie header (cookie_refused), or a logs token issued for Logpush (wrong_transport).
refused
A method other than POST. Allow: POST.
refused
The body is over 8 KiB.
refused
Too many records for this token right now, with Retry-After. The library does not retry it.
retry
doubleshift cannot store the record right now, with Retry-After. The library retries once.
A redirect is not followed and is not retried.

What a 202 means

202 confirms that doubleshift has stored the record, including when the same record was already stored. Counting happens later: it does not confirm that the record was counted, nor that an AI agent read the card. A timeout or a 503 can come after storage, so neither proves the record was lost.

Keep the logs token secret

Store it as a Worker secret (DOUBLESHIFT_LOGS_TOKEN), never in code or configuration; it allows sending records only, and doubleshift revokes and replaces it if it is exposed (keys and tokens).