# Initiate file upload **POST /employers/{employerId}/uploads** Initiate an upload of a Contribution or Enrolment file. Returns a pre-signed URL where the file should be sent via PUT request. We recommend using the AWS S3 client SDK to perform the upload. ## Servers - Production: https://partner-api.getpenfold.com/v1 (Production) - Staging: https://partner-api.getpenfold.dev/v1 (Staging) ## Authentication methods - Bearer auth ## Parameters ### Path parameters - **employerId** (string(uuid)) Penfold employer UUID ### Body: application/json (object) - **filename** (string) The filename of the upload. - **purpose** (string) The purpose of the file upload. If "contribution", both contributions and enrolments will be processed. If "enrolment", only enrolments will be processed. ## Responses ### 200 Successfully initiated the upload. #### Body: application/json (object) - **id** (string) ID of the upload. - **employerId** (string | null) ID of the employer the upload was made for. - **putDestinationUrl** (string | null) Destination URL where the actual file should be sent, using a PUT request. Only present when status is AwaitingFile. We recommend using the AWS S3 client SDK to perform the upload. - **createdAt** (string(date-time)) Datetime the upload was created. - **updatedAt** (string(date-time)) Datetime the upload was last updated. - **processingStarted** (string(date-time) | null) Datetime of when processing of the file began. - **processingEnded** (string(date-time) | null) Datetime of when processing of the file ended, or null if it has not ended. - **processingTime** (number | null) The number of seconds it took to process the file end-to-end (if applicable). - **totalErrors** (number) The number of errors produced in processing the file. Zero if there are none or processing is not finished. Use the `{uploadId}/errors` endpoint to retrieve detailed information. - **contributionsCreated** (number) The number of contributions created during processing. Zero if processing is not finished. - **contributionsUnprocessed** (number) The number of contributions that failed to be created during processing. Zero if processing is not finished. - **contributionsAlreadyExisted** (number) The number of contributions that already existed prior to processing and were skipped. Zero if processing is not finished. - **employerContributions** (number) The total of employer contributions created for the upload, excluding those that already existed. Zero if processing is not finished. - **employeeContributions** (number) The total of employee contributions created for the upload, excluding those that already existed. Zero if processing is not finished. - **totalContributions** (number) The total of all contributions created for the upload, excluding those that already existed. Zero if processing is not finished. - **filename** (string | null) The filename of the uploaded file (if applicable). - **status** (string) The status of the upload. Error indicates the file was not able to be processed. PartiallyProcessed indicates that some but not all contributions or enrolments were created. ### 400 Request body failed validation #### Body: application/json (object) - **error** (string) A descriptive error message. - **validationErrors** (array[object]) ### 401 Missing or invalid authentication token #### Body: application/json (object) - **error** (string) ### 404 Resource not found #### Body: application/json (object) - **error** (string) ### 500 Internal server error #### Body: application/json (object) - **error** (string) [Powered by Bump.sh](https://bump.sh)