Upload Employee File

Uploads a file to an employee's file section. The request must be a multipart/form-data POST. On success, a Location header is returned with the URL of the newly created file resource. The file must be under 20MB and use a supported extension. Pass 0 as the employee ID to use the employee associated with the authenticated caller. Employees may upload to their own folder if the company has employee document uploads enabled.

OAuth Scopes: employee:file.write

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Sample Request

POST /api/v1/employees/1/files/ HTTP/1.0
Host: {companyDomain}.bamboohr.com
Content-Type: multipart/form-data; boundary=----BambooHR-MultiPart-Mime-Boundary----
Content-Length: 520
 
------BambooHR-MultiPart-Mime-Boundary----
Content-Disposition: form-data; name="category"
 
112
------BambooHR-MultiPart-Mime-Boundary----
Content-Disposition: form-data; name="fileName"
 
readme.txt
------BambooHR-MultiPart-Mime-Boundary----
Content-Disposition: form-data; name="share"
 
yes
------BambooHR-MultiPart-Mime-Boundary----
Content-Disposition: form-data; name="file"; filename="readme.txt"
Content-Type: text/plain
 
This is a sample text file.
 
------BambooHR-MultiPart-Mime-Boundary------

Submission Fields

category - the category ID to place the new file in.
fileName - the file name to associate with the file.
share - whether to make the file available to the employee (options are "yes" and "no").
file - the file to upload. Note that the field must be named "file".

Special Notes

The file upload methods accept multi-part forms. To build a multi-part form concatenate the individual sections together separated by a boundary. Then take the length of the resulting body and use that as the Content-Length for the submission.

Path Params
string
required
Defaults to 0

The internal employee ID of the employee to upload the file for. The special employee ID of zero (0) means to use the employee ID associated with the authenticated caller, when one exists.

Body Params
string
required

The display name for the uploaded file.

integer
required

The ID of the employee file section to upload the file into.

string
enum

Whether to share the file with the employee. Accepted values: yes or no. Defaults to no.

Allowed:
file
required

The file to upload.

Responses
201

The file was uploaded successfully. The Location header contains the URL of the new file resource.

400

The request is invalid: missing file name, missing file, zero-byte file, or unsupported file extension.

403

The API user does not have permission to access the requested employee or their file section.

404

The employee or the specified file category was not found.

413

The file exceeds the 20MB limit or the company's storage limit.

503

The file storage API is temporarily unavailable.

Language
Credentials
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!