add_file

Add a file

act entity tenant-private since 2026-10-01

Adds one small file to the org from its bytes (base64, up to 180,000 bytes decoded), to be filed as a person's upload is. For an agent acting for a customer; a person uploads with create_upload.

Contract

shape
entity
authority
act
evidence
none
subscription
false
permission
any one of: org.member (carried by the caller's role template in the org `org_id`); a deactivated caller is refused first
idempotency
keyed
emits
intake.received
MCP tool
add_file
decision_set
approve, reject
REST
POST https://api.containertradehq.com/v1/cap/add_file

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 the file is for.
namenamerequired1 to 255 characters
The file's name, as people will see it. It is never part of where the file is stored.
content_typetextrequired1 to 255 characters
The file's content type, such as application/pdf.
contenttextrequired0 to 240000 characters
The file's bytes, standard base64.
data_classone_ofoptionalone of operational, commercial, financial, personal; default "operational"
What kind of fact the file holds, which decides who may read its bytes: operational (the default), commercial, financial or personal.

Response

  • upload_id · string · The file's intake id.
  • org_id · string · The org the file is for.
  • state · string · received: it is waiting to be filed.
  • size · integer · Its size in bytes.
  • content_type · string · Its content type, as given.
Full JSON Schema
{
  "type": "object",
  "properties": {
    "upload_id": {
      "type": "string",
      "description": "The file's intake id.",
      "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 the file is for.",
      "x-data-class": "operational"
    },
    "state": {
      "type": "string",
      "enum": [
        "received"
      ],
      "description": "received: it is waiting to be filed.",
      "x-data-class": "operational"
    },
    "size": {
      "type": "integer",
      "description": "Its size in bytes.",
      "x-data-class": "operational"
    },
    "content_type": {
      "type": "string",
      "description": "Its content type, as given.",
      "x-data-class": "operational"
    }
  },
  "required": [
    "upload_id",
    "org_id",
    "state",
    "size",
    "content_type"
  ],
  "additionalProperties": false
}

Refusals

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

Surfaces

DesktopN
MobileN
APIF
MCPF*
VoiceN
PushF
OneBoxN
OutboundN
  • Desktop: a person uploads with create_upload
  • Mobile: a person uploads with create_upload
  • MCP: approval required
  • Voice: a voice surface has no file to add
  • OneBox: a document arrives through the intake's own channels
  • Outbound: crosses to no counterparty

Events

Related

claim_party, create_upload, invite_guest