Crossly Activity log
Latest: v1.0.0
Initial release
Debug and audit with the Crossly Activity Log
Every action Crossly takes for a seller (a crosspost, a delist after a sale, a price change, an automation run, a connection check, an email it read) is an event in the Activity Log, with its outcome, who or what triggered it, and the marketplace calls it made. When something "didn't happen", read the log before retrying.
Scopes: activity:read for the log, email events (read) and detected events (read); orders:write to confirm, dismiss or reprocess email events and to confirm/undo detected events; detection rules need orders:read/listings:read to read and orders:write (some routes also accept automation:write) to change. On a multi-store account these act on the store in X-Storefront-Id (else the default store). Conventions: crossly-api-conventions.
Setup
- Create a free Crossly account: https://crossly.net/register
- Create a personal access token at https://crossly.net/settings/api/tokens/new (guide: https://crossly.net/guides/personal-access-tokens). Use a
crossly_pat_test_token against the sandbox while building. - Export it as
CROSSLY_PATand send it asAuthorization: Bearer $CROSSLY_PATtohttps://crossly.net/api/v1/*. Full docs: https://crossly.net/docs
Search the log
GET /v1/action-log, newest first, cursor-paged (limit 1-200, default 50; pass pagination.nextCursor back as cursor; pagination.total counts the matches). Filters, all optional and ANDed:
| Param | Meaning |
|---|---|
area | listings, inventory, orders, shipping, messages, automations, connections, settings, billing, account, emails |
status | pending, success, failure, partial, skipped |
platform | a platform id (ebay, poshmark, …) |
action | a canonical action key such as listing.delist |
category, source | narrower classification and what triggered it |
targetType + targetId | everything about one object (a listing, item, order…) |
actorUserId | what one team member did |
q | the activity query language, e.g. action:listing.* -outcome:failure "free text" (max 512 chars) |
since / until | ISO 8601; since inclusive, until exclusive |
at | jump to a time: the page starts at the newest event at or before it |
offset still works up to 1,000 deep but is deprecated; use cursor.
import { createClient } from '@crossly/sdk';
const crossly = createClient({ pat: process.env.CROSSLY_PAT! });
// Every failed delist on Mercari this week
for await (const e of crossly.actionLog.iterate({ area: 'listings', status: 'failure', platform: 'mercari',
since: new Date(Date.now() - 7 * 864e5).toISOString() }, 500)) {
console.log(e);
}
curl -sS "https://crossly.net/api/v1/action-log?targetType=listing&targetId=$LISTING_ID&limit=50" \
-H "Authorization: Bearer $CROSSLY_PAT"
Each event carries view (a title, a sentence, fields, failure advice and who did it) plus a typed detail. Show view to people; branch on action, status, httpStatus and errorClass in code.
- Natural language:
POST /v1/action-log/search/translatewith{ "text": "failed delists on Mercari last week" }(max 2,000 chars) returns{ q, explanation, assumptions }. Nothing runs: passqto the list, histogram or an export. A404withdetails.code: "not_enabled"means the feature is off for the account. SDK:crossly.actionLog.translateSearch(text). - Filter options:
GET /v1/action-log/facets(last 90 days: areas with their actions and counts, actors, platforms, outcomes). SDKfacets(). - Volume:
GET /v1/action-log/histogram(events per UTC day, same filters, default 30 days, at most 366). SDKhistogram(params).
Open one event
GET /v1/action-log/{id}: the event withcorrelationId,actorType,oauthAppId(when an app did it),platform,accountSlot,targetType/targetId,status,httpStatus,errorClass,errorMessage,latencyMs, andview.steps(plusview.childrenfor a bulk job). SDKcrossly.actionLog.get(id).GET /v1/action-log/{id}/calls: the outbound marketplace HTTP calls under it, oldest first: platform, operation, method, host, status, latency, error class and message, proxy and recipe id. URL paths, bodies and query hashes are never returned. SDKcalls(id).
Quote an event's correlationId (and an API error's correlationId) when you contact Crossly support.
Export
POST /v1/action-log/exports with { format: "csv" | "ndjson" | "pdf", report?: "events" | "summary", filters?: { …same filters as the list… } } queues an export (a summary report is pdf or ndjson). Poll GET /v1/action-log/exports/{exportId} until state is done, then GET /v1/action-log/exports/{exportId}/download (available for 24 h). Exports never contain IP addresses. SDK: createExport, getExport, downloadExport.
Email-detected events
For marketplaces that report some things only by email, Crossly reads the seller's connected mailbox. An email it was not certain enough to act on waits for review:
GET /v1/email-events?status=needs_reviewlists them (a possible sale, ended listing, cancellation…);GET /v1/email-events/{id}shows the outcome, extracted fields and mailbox;GET /v1/email-events/{id}/previewis a sanitized text preview (buyer address lines hidden). Emails are kept 30 days; after that the preview is a409.POST /v1/email-events/{id}/confirmre-runs it as certain (a possible sale records the sale and delists the item elsewhere). If several listings could be meant, send{ "platformListingDbId": "<uuid>" }.POST /v1/email-events/{id}/dismisscloses it without acting ("not a sale").POST /v1/email-events/{id}/reprocessre-reads an email with the current templates; refused (409) once the email already changed something or its copy is gone.
SDK: crossly.emailEvents.list(), get, preview, confirm, dismiss, reprocess. Confirming a sale delists the item on every other marketplace: ask the seller first.
Detected events and their rules
Crossly turns every signal (a webhook, a poll, an email) into a detected event (a sale, an order change, a listing change, an offer, a message, an account notice) and decides what to do with it from the store's rules.
GET /v1/detected-events/events(cursor-paged; filterkinds,platforms,accounts,statuses,channels,itemId,listingId,orderId,ruleId,ownership,since) andGET /v1/detected-events/events/{id}: every report of the event, the rule that decided it, the guards that held actions back, and each action's outcome, withcanConfirmandcanUndo.- Act on one:
POST /v1/detected-events/events/{id}/confirm(answer an open ask),…/undo,…/dismiss(optionalreason),…/reject(wrong item match, optionalitemId). - Understand the policy:
GET /v1/detected-events/situations(every situation Crossly decides, by topic),GET /v1/detected-events/overview(what the store does today in each, and where it differs from the default),GET /v1/detected-events/starting-point(hands_on,balanced,hands_off, orcustom). - Change it:
GET/POST /v1/detected-events/rules,GET /v1/detected-events/rules/{ref}(ref= a rule id ordefault:<key>),PUT/DELETE /v1/detected-events/rules/{id},POST /v1/detected-events/rules/reorder(idstop-down, first match wins unless a rule sayscontinue),POST /v1/detected-events/rules/reset-defaults,POST /v1/detected-events/rules/place(save one rule and the order atomically),POST /v1/detected-events/rules/{ref}/copy(to other stores). Preview a starting point withPOST /v1/detected-events/starting-point/preview, apply it withPUT /v1/detected-events/starting-point. - Try before saving:
POST /v1/detected-events/simulate(one event against draft rules) andPOST /v1/detected-events/simulate/impact(draft rules against recent history).
SDK: crossly.detectedEvents.listEvents, getEvent, confirmEvent, undoEvent, dismissEvent, rejectEventMatch, listRules, getRule, createRule, updateRule, deleteRule, reorderRules, resetDefaults, placeRule, simulate, simulateImpact, listSituations, overview, getStartingPoint, previewStartingPoint, applyStartingPoint, copyRuleToStores.
GET /v1/event-policies and its sub-routes are deprecated in favour of /v1/detected-events/* (they answer with a Link to /v1/detected-events/overview). Don't build on them.
A debugging recipe
- A crosspost row is
failed(see crossly-crosspost): listGET /v1/action-log?targetType=listing&targetId=<listingId>&status=failure. - Open the newest event:
viewsays what went wrong in words and what to do about it;errorClassandhttpStatussay where it failed. …/{id}/callsshows whether the marketplace was reached and what it answered.- Fix the cause (missing field, disconnected account: see crossly-marketplace-connections), then retry once. Don't loop.
Rules
- Read the log before retrying an action that "didn't work": many were skipped on purpose (
status: skipped) with the reason inview. - Confirming, undoing or reprocessing changes the store (records sales, delists): confirm with the seller first.
- Page with
cursor, notoffset. - Detail and calls can include buyer names in
view; treat the log as personal data and don't copy it into public places.
Docs: https://crossly.net/docs/detected-events · https://crossly.net/docs/api-errors
