export_org_data

Export an org's data

act document tenant-private since 2026-10-01

Exports every record of one org to a single JSON Lines file: a header naming the org, when it was read, how many rows each table holds and which columns were withheld, then one line per row. Columns that carry a credential (a password, secret, token or key hash) are never exported. Answers 202 with the export's id while it is queued; the export is built in the background and a download link, signed and good for 24 hours, is emailed to whoever asked. One export of an org runs at a time.

Contract

shape
document
authority
act
evidence
none
subscription
false
permission
any one of: staff.ops (the staff role staff_ops held in the Internal org, tradehq_role.staff_role); org.admin (carried by the caller's role template in the org `org_id`); a deactivated caller is refused first
idempotency
keyed
emits
export.requested, export.ready
MCP tool
export_org_data
decision_set
approve, reject, escalate
REST
POST https://api.containertradehq.com/v1/cap/export_org_data

Through MCP this call returns an approval request first; see Approvals.

Idempotency: keyed by the caller's Idempotency-Key, which is required: the same key and inputs replay the first result, the same key with other inputs is 409 idempotency_key_reused

Inputs

nametyperequiredvalidation
org_idorg_idrequiredtradehq-org-id; 1 to 20 characters
The org whose data is exported.

Response

  • export_id · string · The export: ox and eighteen characters, derived from the Idempotency-Key.
  • org_id · string · The org.
  • status · string · queued when first answered (202); a replay answers where it is now.
Full JSON Schema
{
  "type": "object",
  "properties": {
    "export_id": {
      "type": "string",
      "description": "The export: ox and eighteen characters, derived from the Idempotency-Key.",
      "x-data-class": "operational"
    },
    "org_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20,
      "pattern": "^[A-Za-z0-9_-]{1,20}$",
      "format": "tradehq-org-id",
      "description": "The org.",
      "x-data-class": "operational"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "ready",
        "failed"
      ],
      "description": "queued when first answered (202); a replay answers where it is now.",
      "x-data-class": "operational"
    }
  },
  "required": [
    "export_id",
    "org_id",
    "status"
  ],
  "additionalProperties": false
}

Refusals

  • org_export_unavailable · 422 · this deployment has no object store, no link key or no run route for org exports yet
  • org_export_running · 409 · an export of this org is still queued or running; wait for its link
  • idempotency_key_reused · 409 · this Idempotency-Key already made an export of another org, or by someone else
  • retry_key_mismatch · 409 · the Idempotency-Key was already used with different inputs
  • retry_key_in_flight · 409 · a request with this Idempotency-Key is still running
  • retry_key_lost · 409 · another request took over this Idempotency-Key first; no export was made

The platform refusals apply to every call: version, authentication, authority, validation and rate limits, each in the same envelope.

Surfaces

DesktopF
MobileN
APIF
MCPF*
VoiceN
PushF
OneBoxN
OutboundF
  • Mobile: D1: the result is a file to download and keep, which a phone does not hold
  • MCP: approval required
  • Voice: D1: the result is a file to download and keep, which a voice surface cannot hand over
  • OneBox: no document originates an org export

Events

Related

None.