API documentation

Policy encoding

Policy should be encoded as a reviewed, versioned Decionis artifact rather than hidden inside connector code, wrappers, or partner-specific middleware. When policy lives across PDFs, markdown, Jira, Confluence, XML, transaction logs, SAP notes, or uploads, start with a draft and then persist the accepted version.

Draft flow

Draft generation turns scattered source material into a strategy-shaped Decionis artifact that can be reviewed before versioning.

StageWhat happens
Collect sourcesProvide pasted text, direct-upload artifacts such as PDF or markdown exports, and optionally live pull connectors for Jira, Confluence, SAP, Google Drive, Notion, or a Git-backed repository.
ExtractDecionis can pull live connector content on demand, normalizes the readable text, uses the configured LLM when available, and falls back to deterministic extraction heuristics when it is not.
ReviewThe draft response includes extracted source metadata, warnings, open questions, review checklist items, and strategy-compatible JSON.
VersionOnce accepted, persist the reviewed draft through the existing policy strategy create path so it becomes the next version in the policy family.

Draft endpoint

Use this route when policy intent lives across multiple silos and needs to be converted into a reviewable Decionis strategy draft.

POST/v1/orgs/:orgId/policies/strategies/draftAPI key

Generate a non-persistent policy draft from pasted text, uploads, and optional live pull connectors.

curl -X POST https://api.decionis.com/v1/orgs/<org_id>/policies/strategies/draft \
  -H "Authorization: Bearer sk_org_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "suggested_name": "finance-routing-approval",
    "workflow_key": "finance_routing_approval",
    "live_connector_ids": ["<jira_connector_uuid>", "<confluence_connector_uuid>"],
    "sources": [
      {
        "label": "Jira approval flow",
        "source_type": "JIRA",
        "content": "Invoices above 10000 EUR require finance manager review before payment."
      },
      {
        "label": "Procurement policy PDF",
        "source_type": "UPLOAD",
        "file_name": "procurement-policy.pdf",
        "content_type": "application/pdf",
        "content_base64": "<base64>"
      }
    ]
  }'
{
  "generated_at": "2026-04-22T10:30:00.000Z",
  "draft": {
    "used_llm": true,
    "suggested_name": "finance-routing-approval",
    "workflow_key": "finance_routing_approval",
    "summary": "Encoded 2 sources into a draft policy with 1 auto-execute, 2 review, and 1 block/ignore clauses.",
    "strategy": {
      "name": "finance-routing-approval",
      "status": "DRAFT",
      "rollout_percentage": 0,
      "strategy_rules": {
        "min_confidence": 0.85,
        "require_human_review_above_risk": "medium",
        "required_signal_domains": ["JIRA", "PDF"],
        "encoded_policy": {
          "workflow_key": "finance_routing_approval",
          "auto_execute": ["Route low-risk invoices under threshold directly."],
          "escalate_for_review": ["Invoices above 10000 EUR require finance manager review."],
          "ignore_or_block": ["Reject requests missing a vendor reference."]
        }
      },
      "metadata": {
        "review_status": "PENDING_REVIEW",
        "source_materials": [
          { "label": "Jira approval flow", "source_type": "JIRA" },
          { "label": "Finance wiki / AP thresholds", "source_type": "CONFLUENCE" }
        ]
      }
    },
    "review_checklist": ["Review thresholds and owners before publish."],
    "open_questions": ["Confirm the exact confidence threshold for autonomous execution."],
    "warnings": []
  }
}

Source connectors

These routes register reusable live pull connectors that can be selected when generating a policy draft.

GET/v1/orgs/:orgId/policy-sources/connector-typesAPI key

List the live connector types available to this workspace.

POST/v1/orgs/:orgId/policy-sources/connectorsAPI key

Create a reusable live source connector for Jira, Confluence, SAP, Google Drive, Notion, or a Git-backed repository.

{
  "name": "finance-confluence",
  "connector_type": "confluence",
  "poll_interval_minutes": 60,
  "config": {
    "base_url": "https://your-domain.atlassian.net/wiki",
    "space_keys": "FINANCE",
    "max_results": 10
  },
  "credentials": {
    "email": "policy-bot@example.com",
    "api_token": "<token>"
  }
}
POST/v1/orgs/:orgId/policy-sources/connectors/:connectorId/pullAPI key

Run an immediate live pull and update the connector's pull status.

Bundle contract

After review, submit a stable versioned artifact for downstream Decision Dossier lineage. This synthetic Commerce Gate example is an unreleased source candidate; its threshold and disabled checks are not production recommendations.

{
  "protocol_version": "1.0.0",
  "bundle_id": "22222222-2222-4222-8222-222222222222",
  "org_id": "11111111-1111-4111-8111-111111111111",
  "version": "commerce-review-example-v1",
  "effective_from": "2026-10-04T00:00:00.000Z",
  "rules": [
    {
      "rule_id": "review-commerce-proposals",
      "name": "Review commerce proposals",
      "decision_domain": "*",
      "when": {
        "all": [
          {
            "field": "decision_type",
            "operator": "EXISTS"
          }
        ]
      },
      "then": {
        "action": "REQUIRE_REVIEW"
      },
      "priority": 100,
      "enabled": true
    }
  ],
  "commerce_preflight": {
    "version": "commerce-preflight-v2",
    "max_fact_age_seconds": 300,
    "allowed_sources": [
      "synthetic-demo"
    ],
    "checks": {
      "P01": {
        "enabled": true,
        "floor_percent": 20
      },
      "P02": {
        "enabled": false
      },
      "P03": {
        "enabled": false
      },
      "P04": {
        "enabled": false
      },
      "P05": {
        "enabled": false
      },
      "P06": {
        "enabled": false
      },
      "P07": {
        "enabled": false
      },
      "P08": {
        "enabled": false
      },
      "P09": {
        "enabled": false
      },
      "P10": {
        "enabled": false
      },
      "P11": {
        "enabled": false
      },
      "P12": {
        "enabled": false
      },
      "P13": {
        "enabled": false
      },
      "P14": {
        "enabled": false
      },
      "P15": {
        "enabled": false
      },
      "P16": {
        "enabled": false
      }
    }
  }
}

The optional commerce_preflight block carries reviewed server-owned policy configuration. Preview validation rejects a present malformed block; omission remains compatible with legacy bundles. A valid envelope or successful submission does not establish activation, policy selection or a successful action evaluation.

Selected commerce policy configuration

Source candidate requiring the matching backend. An authorized policy reader can inspect the configuration selected for the current server time before preparing a proposal-specific preflight.

GET/v1/protocol/policies/commerce/readinessVIEWER access and policy:read, policy:* or org:* scope for the requested organization

Read selected policy identity, digests and all sixteen configuration states.

GET https://api.decionis.com/v1/protocol/policies/commerce/readiness?org_id=11111111-1111-4111-8111-111111111111&policy_version=commerce-review-example-v1

org_id is a required UUID. policy_version is optional, trimmed, nonempty and at most 100 UTF-16 code units. Unknown or duplicate query fields are rejected. Use the matching direct API route; existing MCP or AWS decision-only credentials do not imply access.

Check stateMeaning
enabledThe valid selected policy explicitly enables this check.
disabledThe valid selected policy explicitly sets enabled:false.
missingThe selected policy omits the configuration block or this check.
unsupportedA present block fails the canonical schema; all sixteen rows are unsupported.
unavailableNo selectable active bundle was found.

configuration_complete means all sixteen checks are explicitly configured. all_disabled additionally means all sixteen are false. Neither flag is an action verdict, policy activation, connector authorization or release readiness. A valid partial block retains its configured rows and marks omitted checks missing.

HTTP 200 can report missing, unsupported or unavailable configuration. This GET does not evaluate or write a commerce action, create or activate a policy, or replace a proposal-specific preflight. Responses use private, no-store caching. An upstream failure or invalid or mismatched report returns a bounded 502 error.

Effective timestamps are normalized for display. Snapshot digests still cover the stored policy values.

Review and versioning

Draft generation does not persist anything by itself. Persist the accepted result through the strategy create route, and use the protocol bundle route when an integration submits policy directly.

POST/v1/orgs/:orgId/policies/strategiesAPI key

Persist the reviewed draft as the next version in a policy family.

curl -X POST https://api.decionis.com/v1/orgs/<org_id>/policies/strategies \
  -H "Authorization: Bearer sk_org_xxx" \
  -H "Content-Type: application/json" \
  -d @draft-reviewed-policy.json
POST/v1/protocol/policies/bundlesAPI key

Submit a protocol-level versioned policy bundle when an integration participates directly in policy authoring.

POST/v1/protocol/executions/dispatchesAPI key

Submit a governed execution dispatch artifact when the partner also participates in downstream execution.

Required fields

These fields define the minimum useful identity, review, and lineage for draft generation and published policy artifacts.

FieldDescription
org_idRequired for bundles and draft requests: owning Decionis organization identifier.
sourcesDraft endpoint input. Source array with pasted text or uploaded file content encoded as base64.
live_connector_idsOptional draft endpoint input. Existing policy source connector IDs to pull live during draft generation.
suggested_nameOptional draft-only policy family name to guide the output.
workflow_keyDraft-only workflow scope; bundle rules use decision_domain.
review_checklist / open_questionsDraft endpoint output used to drive human review before a version is saved.
protocol_versionRequired bundle field: a supported 1.x protocol version.
bundle_idRequired bundle field: UUID identifying the bundle.
versionRequired bundle field: nonempty version label, at most 100 characters.
effective_fromRequired bundle field: start of the policy validity interval as an ISO timestamp.
rulesRequired bundle field: a nonempty array of canonical policy rules.
commerce_preflightOptional bundle field: reviewed sixteen-check Commerce Gate policy configuration.
metadata.authorOptional bundle metadata identifying the author.