Upload file

Upload a file with a multipart/form-data request. Send the file itself plus a type describing what the file is for; the response returns the id of the stored file.

Files are attached to a record in one of two ways, depending on the type.

Attached on upload. Send linkedTo with the id of the record the file belongs to and the file is attached immediately, appearing in that record's files (see Search files).

  • person — a person's files. Requires Write Files.
  • business — a business's files. Requires Limited Write Contributions or Full Write Accounting.
  • sermon — a sermon's files. Requires Full Write Sermons.
  • batch — a contribution batch's files. Requires Limited Write Contributions.
  • bank_reconciliation — a bank reconciliation's files. Requires Full Write Accounting.

Attached by a later request. Omit linkedTo, then send the returned id in the files array of the record you save next. The file stays unattached until that request succeeds.

Uploads of person, business, transaction_file, journal_entry and safeguard files count against your account's storage capacity, and are rejected while the account is on a trial or once that capacity is exhausted.

Required permission: Write Files or Limited Write Contributions or Full Write Accounting or Full Write Sermons or Write Safeguards

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
file | null
required

The file to upload, sent as the file part of the multipart body. Files larger than 300 MB are streamed rather than buffered.

string | null
required

What the file is for. Determines where the file is stored, the permission required to upload it, and how it is attached to a record. One of person, business, sermon, batch, bank_reconciliation, transaction_file, journal_entry or safeguard.

int32 | null

The id of the record the file belongs to. Send it with person, business, sermon, batch and bank_reconciliation, which attach the file as soon as it is uploaded. Leave it off for transaction_file, journal_entry and safeguard, which are attached by the request that saves the record.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

401

Authentication is required, or the Ocs-Api-Key header is missing or invalid.

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json