> ## Documentation Index
> Fetch the complete documentation index at: https://developer.vanta.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Complete an auditor file upload and attach the file

> Completes an auditor file upload by validating the file and attaching it
to the information request. First start an upload with
`POST /v1/audits/{auditId}/information-requests/{requestId}/auditor-files/uploads`,
then transfer the file to the returned `url` and wait for its 2xx response.
Calling finalize before the file arrives ends that upload; start a new one.

Send `{ "uploadId": "<returned uploadId>" }` using the same application,
audit and information request that started the upload. Vanta uses the
auditor identified by `email` at the start; that auditor must still be an
active user in your firm with audit access. Unsupported file types return
`422` during finalization.

A 201 response contains the attached file's `id`, which differs from
`uploadId`. Use `GET /v1/audits/{auditId}/information-requests/{requestId}/auditor-files`
to find that ID and obtain a temporary download URL.

Retry the same upload ID with backoff after a lost response, a 5xx or a 429.
Stop retrying at `finalizationExpiresAt`. A 409 means the audit is
completed; stop this attempt. For 404, 413 or 422, stop this attempt and
correct the input or start a new upload.

A 429 can mean too many requests, another finalization of this upload is
still running, or too many files are being finalized for this application
and customer.
After a failed attempt, you may need to wait up to 60 seconds before
retrying. Expired uploads, missing files and unsupported files return 422;
files over 50MB return 413. Retrying a finalization
that already succeeded returns the original auditor file ID, even if the
file was later deleted; it does not attach the file again. Current access
is still required.

Rate limit: 10 requests / minute.



## OpenAPI

````yaml https://spec.speakeasy.com/vanta/vanta/conduct-an-audit-with-code-samples post /audits/{auditId}/information-requests/{requestId}/auditor-files/uploads/finalize
openapi: 3.0.0
info:
  title: Conduct an audit
  version: 1.0.0
  description: >-
    The Auditor API lets audit firms conduct audits from a tool outside of
    Vanta. Unlock data syncing with Vanta through this API.


    **Note for Vanta Gov (FedRAMP) customers:** Select `Vanta Gov (FedRAMP)`
    from the server dropdown to issue requests against
    `https://api.vanta-gov.com`. The OAuth token URL shown below defaults to the
    commercial host — replace it with `https://api.vanta-gov.com/oauth/token`.
  termsOfService: https://www.vanta.com/terms
  license:
    name: UNLICENSED
  contact:
    name: API Support
    url: https://help.vanta.com/
    email: support@vanta.com
servers:
  - url: https://api.vanta.com/v1
    description: Vanta (Commercial)
  - url: https://api.vanta-gov.com/v1
    description: Vanta Gov (FedRAMP)
security: []
paths:
  /audits/{auditId}/information-requests/{requestId}/auditor-files/uploads/finalize:
    post:
      tags:
        - Audits
      summary: Complete an auditor file upload and attach the file
      description: >-
        Completes an auditor file upload by validating the file and attaching it

        to the information request. First start an upload with

        `POST
        /v1/audits/{auditId}/information-requests/{requestId}/auditor-files/uploads`,

        then transfer the file to the returned `url` and wait for its 2xx
        response.

        Calling finalize before the file arrives ends that upload; start a new
        one.


        Send `{ "uploadId": "<returned uploadId>" }` using the same application,

        audit and information request that started the upload. Vanta uses the

        auditor identified by `email` at the start; that auditor must still be
        an

        active user in your firm with audit access. Unsupported file types
        return

        `422` during finalization.


        A 201 response contains the attached file's `id`, which differs from

        `uploadId`. Use `GET
        /v1/audits/{auditId}/information-requests/{requestId}/auditor-files`

        to find that ID and obtain a temporary download URL.


        Retry the same upload ID with backoff after a lost response, a 5xx or a
        429.

        Stop retrying at `finalizationExpiresAt`. A 409 means the audit is

        completed; stop this attempt. For 404, 413 or 422, stop this attempt and

        correct the input or start a new upload.


        A 429 can mean too many requests, another finalization of this upload is

        still running, or too many files are being finalized for this
        application

        and customer.

        After a failed attempt, you may need to wait up to 60 seconds before

        retrying. Expired uploads, missing files and unsupported files return
        422;

        files over 50MB return 413. Retrying a finalization

        that already succeeded returns the original auditor file ID, even if the

        file was later deleted; it does not attach the file again. Current
        access

        is still required.


        Rate limit: 10 requests / minute.
      operationId: FinalizeInformationRequestAuditorFileUpload
      parameters:
        - in: path
          name: auditId
          required: true
          schema:
            type: string
        - in: path
          name: requestId
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FinalizeAuditorFileUploadInput'
      responses:
        '201':
          description: Auditor file attached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadedAuditorFile'
              examples:
                Example 1:
                  value:
                    id: 65fc81a3359c8508c9af880f
        '400':
          description: Invalid request body or path parameters; correct the input
        '401':
          description: Missing or expired Vanta access token
        '403':
          description: The application or original auditor no longer has access
        '404':
          description: >-
            The audit, information request or upload was not found for this
            application and destination
        '409':
          description: The audit is completed; stop this upload attempt
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutboundError'
        '413':
          description: The file exceeds 50MB
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutboundError'
        '422':
          description: >-
            Upload expired, file missing or unsupported, or audit not yet
            available; correct the problem before starting a new upload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutboundError'
        '429':
          description: >-
            Request rate or finalization limit reached; retry the same uploadId
            with backoff before finalizationExpiresAt
        '500':
          description: >-
            Unexpected server error; retry the same uploadId with backoff before
            finalizationExpiresAt
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutboundError'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: FinalizeInformationRequestAuditorFileUpload
          source: |-
            import { Vanta } from "vanta-auditor-api-sdk";

            const vanta = new Vanta({
              bearerAuth: process.env["VANTA_BEARER_AUTH"] ?? "",
            });

            async function run() {
              const result = await vanta.audits.finalizeInformationRequestAuditorFileUpload({
                auditId: "<id>",
                requestId: "<id>",
                finalizeAuditorFileUploadInput: {
                  uploadId: "<id>",
                },
              });

              console.log(result);
            }

            run();
        - lang: java
          label: FinalizeInformationRequestAuditorFileUpload
          source: >-
            package hello.world;


            import com.vanta.vanta_auditor_api.Vanta;

            import
            com.vanta.vanta_auditor_api.models.components.FinalizeAuditorFileUploadInput;

            import com.vanta.vanta_auditor_api.models.errors.OutboundError;

            import
            com.vanta.vanta_auditor_api.models.operations.FinalizeInformationRequestAuditorFileUploadResponse;

            import java.lang.Exception;


            public class Application {

                public static void main(String[] args) throws OutboundError, Exception {

                    Vanta sdk = Vanta.builder()
                            .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
                        .build();

                    FinalizeInformationRequestAuditorFileUploadResponse res = sdk.audits().finalizeInformationRequestAuditorFileUpload()
                            .auditId("<id>")
                            .requestId("<id>")
                            .finalizeAuditorFileUploadInput(FinalizeAuditorFileUploadInput.builder()
                                .uploadId("<id>")
                                .build())
                            .call();

                    if (res.uploadedAuditorFile().isPresent()) {
                        System.out.println(res.uploadedAuditorFile().get());
                    }
                }
            }
components:
  schemas:
    FinalizeAuditorFileUploadInput:
      properties:
        uploadId:
          type: string
          description: >-
            The `uploadId` returned by the start-upload operation for this
            application, audit and information request.
      required:
        - uploadId
      type: object
      additionalProperties: false
    UploadedAuditorFile:
      properties:
        id:
          type: string
          description: >-
            ID of the attached auditor file. Match it to `id` in the
            auditor-files list, or use it as `auditorFileId` when deleting the
            file.
      required:
        - id
      type: object
      additionalProperties: false
    OutboundError:
      properties:
        message:
          type: string
      required:
        - message
      type: object
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

## Related topics

- [Start an auditor file upload](https://developer.vanta.com/api-reference/audits/start-an-auditor-file-upload.md)
- [List auditor files for an information request](https://developer.vanta.com/api-reference/audits/list-auditor-files-for-an-information-request.md)
- [Upload a document](https://developer.vanta.com/docs/guides/upload-a-document.md)
- [Upload file for document](https://developer.vanta.com/api-reference/documents/upload-file-for-document.md)
- [Delete an auditor file from an information request](https://developer.vanta.com/api-reference/audits/delete-an-auditor-file-from-an-information-request.md)
