---
title: "Upload transaction, event or audit records to a policy"
method: POST
path: "/v1/policies/{policyId}/records"
---

# Upload transaction, event or audit records to a policy

`POST /v1/policies/{policyId}/records`

## Request

- Base URL: `https://api.decionis.com`
- URL: `https://api.decionis.com/v1/policies/{policyId}/records`
- Auth: API key in cookie `decionis_account_session`

The owner's door into the central policy intake. Account session of the policy's POLICY_OWNER or SOURCE_CUSTODIAN; same-site JSON and an Idempotency-Key are required. The records are assessed and signed exactly as on /v1/assessments/{assessmentId}/records, and the upload is recorded on the policy's access chain. The findings stay with this policy, and its authors (the desk on a MANAGED policy) receive the findings case. Uploading changes no revision, so the uploader never becomes an author. A policy_id in the body must name this policy.

## Headers

- `Idempotency-Key` string

## Request body

- AssessmentRecords: decionis.assessments.records/1. Records inline or one JSON Lines file, never both. A commerce record is a commerce-preflight-v2 action with its facts as they stood, its time and its transaction-time money; identifiers in the action should be opaque digests.
  - `version` 'decionis.assessments.records/1', required
  - `assessment_id` string, uuid, required
  - `domain` 'commerce' | 'cards' | 'agents', required
  - `kind` 'transaction' | 'event' | 'audit', required
  - `platform` string, required
  - `producer` object, required
    - `product` 'agentsafe' | 'commerce' | 'core', required
    - `surface` 'cli' | 'assistant' | 'dashboard' | 'service' | 'upload', required
    - `version` string, required
  - `as_of` string, date-time, required
  - `window` object, required
    - `from` string, date-time, required
    - `to` string, date-time, required
  - `policy_id` string, uuid: The policy the findings are for; its desk receives them. Without it they go to the workspace's commerce draft (a policy created MANAGED first, then a MANAGED one). Must name a commerce policy in the organization.
  - `total` integer, nullable, required
  - `truncated` boolean, required
  - `records` object[]
  - `file` object
    - `format` 'jsonl', required
    - `name` string
    - `content` string, required

## Response `200`

The findings already signed for these exact records.

- AssessmentRecordsResult
  - `version` 'decionis.assessments.records/1', required
  - `assessment_id` string, uuid, required
  - `domain` 'commerce' | 'cards' | 'agents', required
  - `policy_id` string, uuid, nullable, required: The policy the findings went to; null for the workspace's commerce draft.
  - `received` integer, required: Records received, before duplicates were dropped.
  - `assessed` integer, required
  - `findings` SignedAssessmentFindings, required
    - `artifact` object, required
      - `assessment_id` string, uuid, required
      - `platform` string, required
      - `evaluator` object, required
        - `platform` string, required
        - `methodology` string, required
      - `source` object, required
        - `kind` 'connected_history' | 'recorded_evidence', required
        - `connection_id` string, uuid, nullable, required
        - `company_id` string, nullable, required
        - `revision` string, required
        - `as_of` string, date-time, required
        - `window` object, required
          - `from` string, date-time, required
          - `to` string, date-time, required
      - `status` 'complete' | 'partial', required
      - `coverage` object, required
        - `assessed` integer, required
        - `total` integer, nullable, required
        - `limit` integer, required
        - `truncated` boolean, required
        - `complete` boolean, required
        - `reasons` string[], required
        - `gaps` object[], required
          - `code` string, required
          - `finding_types` string[], required
      - `findings` object[], required
        - `finding_id` string, required
        - `type` string, required
        - `check_id` 'P01' | 'P02' | 'P03' | 'P04' | 'P05' | 'P06' | 'P07' | 'P08' | 'P09' | 'P10' | 'P11' | 'P12' | 'P13' | 'P14' | 'P15' | 'P16', required
        - `record_digest` string, required
        - `occurred_at` string, date-time, required
        - `amount` object, required
          - `currency` string, required
          - `scale` integer, required
          - `amount_minor` integer, required
        - `measurements` object, required
        - `basis` 'source_record' | 'recorded_observation', required
      - `records` object[], required
        - `record_digest` string, required
        - `occurred_at` string, date-time, required
        - `amount` object, nullable, required
          - `currency` string, required
          - `scale` integer, required
          - `amount_minor` integer, required
        - `replay` object, nullable, required
          - `action` union, required
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
          - `facts` CommercePreflightFacts, required
            - `observed_at` string, date-time
            - `source` string
            - `currency` string
            - `pricing` object
              - …
            - `cost_basis` object
              - …
            - `inventory` object
              - …
            - `region` object
              - …
            - `discounts` object
              - …
            - `contract` object
              - …
            - `promotion` object
              - …
            - `refund` object
              - …
            - `lifecycle` object
              - …
            - `payment` object
              - …
            - `beneficiary` object
              - …
            - `treasury` object
              - …
      - `version` 'decionis.assessments.findings/1', required
      - `findings_id` string, uuid, required
      - `org_id` string, uuid, required
      - `submitted_at` string, date-time, required
      - `submission_sha256` string, required
      - `totals` object[], required
        - `type` string, required
        - `check_id` 'P01' | 'P02' | 'P03' | 'P04' | 'P05' | 'P06' | 'P07' | 'P08' | 'P09' | 'P10' | 'P11' | 'P12' | 'P13' | 'P14' | 'P15' | 'P16', required
        - `currency` string, required
        - `scale` integer, required
        - `amount_minor` integer, required
        - `count` integer, required
    - `artifact_sha256` string, required
    - `canonicalization` 'RFC8785/JCS', required
    - `verification` 'signed' | 'unsigned', required
    - `signature` object, nullable, required
      - `algorithm` 'Ed25519', required
      - `keyId` string, required
      - `value` string, required
    - `public_jwks_path` '/.well-known/decision-dossier-jwks.json', required

## Other responses

- `201`: Signed findings from the records.
- `400`: Structured API error
- `401`: Structured API error
- `403`: Structured API error
- `422`: Structured API error

---

[API](https://skmtc.dev/decionis/apis/decionis-policy-evaluation-api.md) · [All operations](https://skmtc.dev/decionis/apis/decionis-policy-evaluation-api/llms.txt) · [OpenAPI document](https://skmtc.dev/decionis/apis/decionis-policy-evaluation-api/revisions/357f5e459d0c?raw)
