# Upload a file

Uploads a CSV file against the upload template named in the `templatename` header.
**Asynchronous mode**(`async=true`): Supported only for templates of type
`Transactions / Cost`, `Event` and `Consumption`.
Returns `202 Accepted` with an upload record. Any other template type returns `400` with
`Template type is currently not supported in Async mode.`
Asynchronous uploads support **partial upload**: records with a valid format and data type
are ingested into Revenue Line Staging, and records with an invalid format or data type are
rejected. Retrieve the rejected records with `GET /v1/upload/file/error/{upload_id}`.
**Synchronous mode**(`async` omitted or `false`): While this mode accepts all upload template types,
it is primarily used for `Bundle`, `Custom`, `Variable Consideration`, and `Forecast` templates.
It returns a `200 OK` along with a `file_request_id`.
Synchronous uploads are strictly all-or-nothing: either the entire file is successfully ingested, or all records are rejected. There is no partial upload in synchronous mode.
**Recommended file size** (records per CSV file):
* Asynchronous - Transactions / Cost and Event: 250,000 - 300,000
* Asynchronous - Consumption: up to 500,000
* Synchronous (non-async): up to 60,000

Tip: Before calling this operation, call the "List upload field mappings" Adapter operation with the `templatename` specified first to get the column labels and
date format the template expects.

Endpoint: POST /api/integration/v1/upload/file
Version: 2026-11-02
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer

## Query parameters:

  - `async` (boolean)
    Set to `true` for an asynchronous upload. Omit, or set to `false`, for a synchronous upload.

## Header parameters:

  - `token` (string, required)
    The valid authentication token that is generated by the Authentication operation.

  - `templatename` (string, required)
    Name of the upload template that you want to use.
Supported file templates for **asynchronous mode**: `Transactions/Cost`, `Event`, `Consumption`.
Supported file templates for **synchronous mode**: `Bundle`, `Custom`, `Variable Consideration`, `Forecast`.

  - `Content-Type` (string, required)
    Must be set to "multipart/form-data".

  - `revenue-data-encoding` (string)
    **Synchronous mode only.**
Set to `base64` when the uploaded file content is Base64-encoded; it is decoded before processing.

## Request fields (multipart/form-data):

  - `file` (string, required)
    The path to the CSV file that is to be uploaded.

## Response 200:

  - `200` (unknown)
    **Synchronous mode.** The file was accepted and staged in Zuora Revenue.

## Response 200 fields (application/json; charset=utf-8):

  - `Status` (string)
    Enum: "Success"

  - `Message` (string)
    Example: File consumed successfully by Revpro

  - `Result` (object)

  - `Result.file_request_id` (string)
    Use with `GET /api/integration/v1/fileupload/status/{file_request_id}`.
    Example: 104523

  - `Result.file_name` (string)
    Example: 104523__bundle_oct_2026_API_FILE.csv

## Response 202:

  - `202` (unknown)
    Asynchronous upload accepted (`async=true`). The upload record is returned without the
response envelope.

## Response 202 fields (application/json; charset=utf-8):

  - `id` (integer)
    Upload id. Use it as `upload_id` in the asynchronous status and error operations.
    Example: 20458

  - `file_name` (string)
    Name under which the file was stored.
    Example: 1048577_Transactions_Oct.csv

  - `client_id` (integer)
    Example: 1

  - `status` (string)
    Example: In Progress

  - `message` (string)
    Example: Data Received

  - `org_id` (string)
    Example: 101

  - `created_by` (string)
    Example: jdoe@acme.com

  - `created_date` (string)
    Example: 2026-10-21T10:15:32

  - `updated_by` (string)
    Example: jdoe@acme.com

  - `updated_date` (string)
    Example: 2026-10-21T10:15:32

## Response 400:

  - `400` (unknown)
    Exception occurs. Please contact Zuora Revenue Support.

## Response 400 fields (application/json; charset=utf-8):

  - `message` (string)
    Response Message

  - `status` (string)
    Response Status

## Response 401:

  - `401` (unknown)
    The token is invalid, expired or could not be decoded.

## Response 401 fields (application/json):

  - `Status` (string, required)
    Enum: "Error"

  - `Message` (any)
    Error message. For a rejected synchronous upload on the v2 status API, a list of load errors.

  - `Result` (any)
    Usually `null`.

## Response 403:

  - `403` (unknown)
    The request is not permitted for this tenant or is missing tenant-required headers.

## Response 403 fields (application/json):

  - `Status` (string, required)
    Enum: "Error"

  - `Message` (any)
    Error message. For a rejected synchronous upload on the v2 status API, a list of load errors.

  - `Result` (any)
    Usually `null`.

  - `Message` (string)

## Response 500:

  - `500` (unknown)
    Unexpected server-side error.

## Response 500 fields (application/json):

  - `Status` (string, required)
    Enum: "Error"

  - `Message` (any)
    Error message. For a rejected synchronous upload on the v2 status API, a list of load errors.

  - `Result` (any)
    Usually `null`.

## Response 502:

  - `502` (unknown)
    A dependent Zuora Revenue service was temporarily unavailable. Retry the request later.

## Response 502 fields (application/json):

  - `Status` (string, required)
    Enum: "Error"

  - `Message` (any)
    Error message. For a rejected synchronous upload on the v2 status API, a list of load errors.

  - `Result` (any)
    Usually `null`.

