Skip to content

api

Fieldloop Batches and Receipts

Submit captured logs, preserve retry identity and inspect admission and row processing separately.

Fieldloop Batches and Receipts

Definition

Submit captured application records to an existing source with a Fieldloop Submission key from Admin → API Keys. New keys carry that capability across the workspace. Configure the intended Project/source; older key restrictions and current permissions remain enforced. Receipt reads belong to the original submitter.

Submit a batch

Replace the fictional record with selected, redacted data in batch.json. Your application owns source_event_id. Each log needs RFC3339 occurred_at and at least one of input, output, messages, trajectory or action. Optional feedback is nested in its log; source relationships use provider_ref, session_ref and trace_ref.

Use the Project URL from the quickstart, an existing issued source ID and one logical batch key. Preserve the exact file/key for uncertain retries.

Endpoint
POST /v1/organizations/{organizationKey}/projects/{projectId}/fieldloop/sources/{sourceId}/batches
Authorization: Bearer <credential from your secret mechanism>
Content-Type: application/json
Idempotency-Key: <application-owned logical batch key>
Captured log body
JSON
{
  "logs": [{
    "source_event_id": "support-ticket-1042:reply",
    "occurred_at": "2026-10-31T09:30:00Z",
    "input": {"question": "Has my bicycle shipped?"},
    "output": {"reply": "Your bicycle is being packed."},
    "context": {"application": "Bicycle Shop"}
  }]
}
Submit a batch
cURL
SOURCE_URL="${PROJECT_URL}/fieldloop/sources/${TEAMMATELY_FIELDLOOP_SOURCE}"
curl --fail-with-body \
  --header "Authorization: Bearer ${TEAMMATELY_API_KEY}" \
  --header 'Content-Type: application/json' \
  --header "Idempotency-Key: ${BATCH_OPERATION_KEY}" \
  --data-binary @batch.json \
  "${SOURCE_URL}/batches"

Read the receipt

202 acknowledges durable receipt of the bytes. Retain data.batch_id:

FieldInterpretation
batch_id, source_id, sequenceIssued identity and destination order
statusuploading, received, processing, processed, failed, cancelled or deleted
row_countSubmitted population
accepted_count, duplicate_countAccepted records and recognized duplicates
conflict_count, rejected_countRows requiring inspection
rows, safe_error_codePer-row outcomes and error code when returned

processed can include rejected/conflicting rows. Polling reads an existing batch rather than submitting another one.

Read a receipt
cURL
curl --fail-with-body \
  --header "Authorization: Bearer ${TEAMMATELY_API_KEY}" \
  "${SOURCE_URL}/batches/${BATCH_ID}"

Recovery and inspection

Replay a lost response with identical bytes/key. Retain source records until admission is known. Inspect Fieldloop → Logs for original content and processing state. Source consent, Threads and Case creation are separate workflows.

SDK guides cover continuous ingestion. FieldloopBatch, FieldloopLog and FieldloopReceiptEnvelope in the OpenAPI define request/receipt fields.

Found something unclear?

Report outdated, unsupported, or confusing docs so we can fix the source page.

Report a docs issue

Continue learning

Related docs