# Upload and attach files

> Upload files and attach them to Rippling resources using the Files API.

## Overview

The Files API allows you to upload documents and attach them to resources inside Rippling. This includes attaching an offer letter to a brand-new hire or dropping an identification document into an existing employee's custom folder.

### Available endpoints

| Endpoint | Description |
| --- | --- |
| [POST Create a new file](https://developer.rippling.com/documentation/rest-api/reference/create-files) | Creates a file placeholder. `content_type` is required. Keep `id`, `upload_url`, and `upload_fields`. |
| [GET Retrieve a specific file](https://developer.rippling.com/documentation/rest-api/reference/get-files) | Returns a file by `id`, including `status`. |
| [POST Create a new employee document](https://developer.rippling.com/documentation/rest-api/reference/create-employee-documents) | Attaches an active file to an existing worker. `worker_id` and `file_id` are required. `folder_id` is optional. |

Related endpoints:

| Endpoint | Description |
| --- | --- |
| [POST Create hire](https://developer.rippling.com/documentation/rest-api/reference/create-hires) | Attaches an active file to a new hire. Send the file `id` on a field such as `employment.resume_file_id`. |

### Suggested workflow

1.  [Create a file](https://developer.rippling.com/documentation/rest-api/reference/create-files) with `content_type`. Keep `id`, `upload_url`, and `upload_fields`.
2.  Upload the file to `upload_url`. Include every key from `upload_fields`, then the file binary. Wait for `204`.
3.  Confirm the upload with `POST /files/{id}/confirm-upload/` using the file `id`. No request body is required.
4.  [Retrieve the file](https://developer.rippling.com/documentation/rest-api/reference/get-files) and wait until `status` is `active` before attaching it.
5.  Attach the file. For a new hire, [create a hire](https://developer.rippling.com/documentation/rest-api/reference/create-hires) and send the file `id` on a field such as `employment.resume_file_id`. For an existing worker, [create an employee document](https://developer.rippling.com/documentation/rest-api/reference/create-employee-documents) with that `file_id`.

### File formats & limits

-   All requests must include the version header `Rippling-Version: 2024-08-01`.
-   Supported file types include `.txt`, `.csv`, `.pdf`, `.png`, `.jpg`, `.jpeg`, `.webp`, `.heic`, `.gif`, `.bmp`, `.tiff`, `.docx`, `.xlsx`, `.pptx`.
-   Maximum 100 MB per file size cap.
-   The temporary upload URL lasts for 24 hours.
-   [POST Create a new employee document](https://developer.rippling.com/documentation/rest-api/reference/create-employee-documents) has a limit of 40 files per request.

* * *

## Requirements

-   The Rippling API SKU
-   An API token with the following scopes:
    -   `files:upload-url.write` to generate placeholders/confirm uploads
    -   `files:upload-url.read` to view file statuses
    -   `hires.read-write` to attach files on a new hire
-   The API token must have rights to manage documents for everyone in your upload scope, and the **Inherit permissions from Permissions App?** setting must be enabled.
-   The target folder must exist, and it must be actively provisioned for the employee's role under the **Select the people you want Rippling to create folders for** menu.

* * *

## Create a file placeholder

Before you can push your file data anywhere, use [POST Create a new file](https://developer.rippling.com/documentation/rest-api/reference/create-files) to create a file tracking placeholder.

_Request:_

```json
curl -L -X POST 'https://rest.ripplingapis.com/files/'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
-H 'Rippling-Version: 2024-08-01'
```

_Request body:_

```json
{
  "content_type": "application/pdf",
  "display_name": "Signed Offer — Jane Doe"
}
```

| Request body field | Required | Description |
| --- | --- | --- |
| `content_type` | Yes | MIME type of the file. |
| `display_name` | No | Human-readable label for the file. |

_Response:_

```json
{
  "id": "67f8a2b3c4d5e6f7a8b9c0d1",
  "status": "awaiting_upload",
  "display_name": "Signed Offer — Jane Doe",
  "content_type": "application/pdf",
  "upload_url": "https://platform-api-upload-cs.s3.amazonaws.com/",
  "upload_fields": { "...": "signed S3 POST policy fields" },
  "url_data": { "s3_url": "...", "preview_url": "..." }
}
```

* * *

## Upload the file

Upload the file binary directly to S3 using `upload_url` and `upload_fields` from [POST Create a new file](https://developer.rippling.com/documentation/rest-api/reference/create-files). Since Rippling is not in this request path, the `Authorization` type will be `No Auth`.

_Request:_

```json
POST <upload_url>
Content-Type: multipart/form-data
```

Your request body needs to include every single key/value item from the `upload_fields` object saved previously, followed by a final field named `file` containing the actual document binary.

**Upload examples:**

-   cURL
-   Python
-   TypeScript
-   TypeScript (fetch)

```bash
curl -X POST "$UPLOAD_URL" \
  $(echo "$UPLOAD_FIELDS_JSON" | jq -r 'to_entries[] | "-F \(.key)=\(.value)"') \
  -F "file=@./offer_letter.pdf"
```

```python
import requests

# upload_url and upload_fields from [POST Create a new file](../reference/create-files.api.mdx)
upload_url = file_response["upload_url"]
upload_fields = file_response["upload_fields"]

with open("offer_letter.pdf", "rb") as f:
    response = requests.post(
        upload_url,
        data=upload_fields,
        files={"file": ("offer_letter.pdf", f, "application/pdf")}
    )

# Expect 204 No Content on success
if response.status_code == 204:
    print("Upload successful")
```

```typescript
import * as fs from "fs";
import FormData from "form-data";
import axios from "axios";

// upload_url and upload_fields from [POST Create a new file](../reference/create-files.api.mdx)
const uploadUrl = fileResponse.upload_url;
const uploadFields = fileResponse.upload_fields;

const form = new FormData();

// Add all fields from upload_fields first
for (const [key, value] of Object.entries(uploadFields)) {
  form.append(key, value as string);
}

// Add the file last
form.append("file", fs.createReadStream("./offer_letter.pdf"));

const response = await axios.post(uploadUrl, form, {
  headers: form.getHeaders(),
  validateStatus: (status) => status === 204,
});

console.log("Upload successful");
```

```typescript
// For browser or Node.js 18+ with native fetch
const uploadUrl = fileResponse.upload_url;
const uploadFields = fileResponse.upload_fields;

const formData = new FormData();

// Add all fields from upload_fields first
for (const [key, value] of Object.entries(uploadFields)) {
  formData.append(key, value as string);
}

// Add the file last (browser: from file input, Node: from Blob)
const fileBuffer = await fs.promises.readFile("./offer_letter.pdf");
const blob = new Blob([fileBuffer], { type: "application/pdf" });
formData.append("file", blob, "offer_letter.pdf");

const response = await fetch(uploadUrl, {
  method: "POST",
  body: formData,
});

if (response.status === 204) {
  console.log("Upload successful");
}
```

_Response:_

S3 will return an empty `204 No Content` status code when the upload completes successfully.

| Error code | Cause |
| --- | --- |
| `400` | File is oversize, empty, or signed fields were altered. |
| `403` | Upload URL has expired. |

* * *

## Confirm the upload

After a successful upload, notify Rippling so it can be unlocked for use. Provide the file tracker ID from [POST Create a new file](https://developer.rippling.com/documentation/rest-api/reference/create-files) directly in the URL path.

_Request:_

```json
curl -L -X POST 'rest.ripplingapis.com/files/67f8a2b3c4d5e6…9c0d1/confirm-upload/'
-H 'Accept: application/json'
-H 'Authorization: Bearer REDACTED'
-H 'Rippling-Version: 2024-08-01'
```

> **Note:**
> No request body is needed for this call.

_Response:_

```json
{
  "id": "67f8a2b3c4d5e6f7a8b9c0d1",
  "status": "active",
  "display_name": "Signed Offer — Jane Doe",
  "content_type": "application/pdf"
}
```

| Error | Cause | How to fix |
| --- | --- | --- |
| `400 upload_not_found_in_s3` | Confirm was called too early. | Wait for the S3 upload to finish successfully, then try again. |
| `404 file_not_found` | The file ID does not exist. | Verify the file tracker ID from [POST Create a new file](https://developer.rippling.com/documentation/rest-api/reference/create-files). |

* * *

## Attach files to Rippling resources

Now that your file status is active, you can choose one of two destinations to attach it to.

### Attach to a draft hire

Attach the file to a draft hire using [POST Create hire](https://developer.rippling.com/documentation/rest-api/reference/create-hires) by sending the file `id` on a hire field that accepts a file, such as `employment.resume_file_id`. A raw file URL is not accepted.

_Request:_

```json
curl -L -X POST 'https://rest.ripplingapis.com/hires/'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
-H 'Rippling-Version: 2024-08-01'
-H 'Idempotency-Key: ats-offer-1001'
```

_Request body:_

```json
{
  "hires": [
    {
      "client_request_id": "ats-offer-1001",
      "hire_type": "direct_hire",
      "personal": {
        "first_name": "Jane",
        "last_name": "Doe",
        "invite_email": "jane.doe@example.com"
      },
      "work_location": {
        "location_id": "674c178fc3f93afc69715ef4",
        "country_code": "US"
      },
      "employment": {
        "title": "Software Engineer",
        "start_date": "2026-12-01",
        "employment_type_id": "674c1785c3f93afc69715d93",
        "legal_entity_id": "674c17a6c3f93afc6971617e",
        "resume_file_id": "67f8a2b3c4d5e6f7a8b9c0d1"
      },
      "compensation": {
        "base_pay_amount": {
          "currency_type": "USD",
          "value": 120000
        },
        "base_pay_period": "YEAR"
      }
    }
  ]
}
```

_Response:_

```json
{
  "ack": true,
  "results": [
    {
      "client_request_id": "ats-offer-1001",
      "id": "68efdd0995c096c490a0012a",
      "existing_role_id": null,
      "status": "ready_for_review",
      "missing_required_fields": [],
      "pending_fields": [],
      "errors": [],
      "next_actions": []
    }
  ]
}
```

Creating the draft hire via the API does not fully hire the person, as an admin has to complete the hire directly in Rippling. See [Create and bulk hire draft hires](https://developer.rippling.com/documentation/rest-api/guides/drafthires) for more information.

### Attach to an existing employee's profile folder

To import a file directly into a folder for an active employee, use [POST Create a new employee document](https://developer.rippling.com/documentation/rest-api/reference/create-employee-documents). This endpoint has a limit of 40 files per request.

_Request:_

```json
curl -L -X POST 'https://rest.ripplingapis.com/employee-documents/'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
-H 'Rippling-Version: 2024-08-01'
```

_Request body:_

```json
{
  "items": [
    {
      "worker_id": "69cd833a068813c0d6bb16e0",
      "folder_id": "6a33309a2a01ff5c27117894",
      "documents": [
        {
          "file_id": "{{file_id}}",
          "name": "Demo from API existing in folder 1.pdf",
          "signature_date": "2026-06-03"
        }
      ]
    }
  ]
}
```

| Request body field | Required | Description |
| --- | --- | --- |
| `worker_id` | Yes | Unique ID of the target employee profile. Call [GET List workers](https://developer.rippling.com/documentation/rest-api/reference/list-workers) for the worker ID. |
| `folder_id` | No | The ID of the folder you found in the UI. If omitted, the file goes to the employee's main root folder. Navigate to **Documents** > **Profile Folders**, click on the folder, and grab the ID from the last part of the URL. |
| `file_id` | Yes | The active file ID returned from [POST Create a new file](https://developer.rippling.com/documentation/rest-api/reference/create-files). |
| `on_invalid_folder` | No | What to do if the folder doesn't exist or you don't have permission. Accepts `fail` (default) or `fallback_to_root`. |

_Response:_

```json
{
    "invalid_items": [],
    "successful_results": [
        {
            "worker_id": "69cd833a068813c0d6bb16e0",
            "status": "success",
            "message": "Files uploaded to role",
            "errors": [],
            "error_code": null,
            "document_results": [
                {
                    "file_id": "6a397705c1fb2026152364f5",
                    "document_id": "6a397a4a21a34e9e51d24f84",
                    "status": "success",
                    "error": null,
                    "error_code": null,
                    "warnings": null
                }
            ]
        }
    ]
}
```

If any of the verification checklist conditions fail, the API response depends entirely on how you configured the `on_invalid_folder` field:

| Error | Cause |
| --- | --- |
| `422 FOLDER_ACCESS_ERROR` | The folder is missing, restricted, or unprovisioned. This error triggers if `on_invalid_folder` is left blank or set to `fail`. The file is rejected and not saved. |
| `201 Created` | Triggers if `on_invalid_folder` is explicitly set to `fallback_to_root`. The API bypasses the validation error, saves the file to the employee's main root profile folder instead, and returns a warning payload. |

_Response example when falling back to the root profile_:

```json
{
  "status": "success",
  "data": {
    "document_id": "doc_124",
    "worker_id": "role_8975",
    "folder_id": null
  },
  "meta": {
    "warnings": [
      {
        "code": "FOLDER_ACCESS_FALLBACK",
        "message": "Unable to access the requested folder_id '7b314c8e6ecb8db29785902b'. Document was successfully uploaded to the root profile based on fallback rules."
      }
    ]
  }
}
```

* * *

## Retrieve file status

Use [GET Retrieve a specific file](https://developer.rippling.com/documentation/rest-api/reference/get-files) to check the background tracking state of a file asset at any point before linking it to the resource.

_Request:_

```json
curl -L -X GET 'https://rest.ripplingapis.com/files/67f8a2b3c4d5e6f7a8b9c0d1/'
-H 'Accept: application/json'
-H 'Authorization: Bearer REDACTED'
-H 'Rippling-Version: 2024-08-01'
```

_Response:_

```json
{
  "id": "67f8a2b3c4d5e6f7a8b9c0d1",
  "status": "active",
  "display_name": "Signed Offer — Jane Doe",
  "content_type": "application/pdf"
}
```

### Status lifecycle

1.  `awaiting_upload` - The first step is complete, and Rippling is waiting for you to upload the data to S3.
2.  `uploaded` - The file has reached S3, and Rippling is currently processing it and running a malware scan.
3.  `active` - The file passed checks and is ready to be attached to a resource.
4.  `infected` - The scanner flagged the file as dangerous, and the document is permanently blocked.

* * *

## Use cases

### Attach an offer letter to a new hire

Upload a signed offer letter and attach it to a draft hire in a single flow.

```python
import requests

# Step 1 — Create file placeholder
response = requests.post(
    "https://rest.ripplingapis.com/files/",
    headers={
        "Authorization": "Bearer <token>",
        "Rippling-Version": "2024-08-01"
    },
    json={
        "content_type": "application/pdf",
        "display_name": "Offer Letter"
    }
)
file_data = response.json()
file_id = file_data["id"]
upload_url = file_data["upload_url"]
upload_fields = file_data["upload_fields"]

# Step 2 — Upload to S3
with open("offer_letter.pdf", "rb") as f:
    requests.post(upload_url, data=upload_fields, files={"file": f})

# Step 3 — Confirm upload
requests.post(
    f"https://rest.ripplingapis.com/files/{file_id}/confirm-upload/",
    headers={
        "Authorization": "Bearer <token>",
        "Rippling-Version": "2024-08-01"
    }
)

# Step 4 — Create the hire with the confirmed file
requests.post(
    "https://rest.ripplingapis.com/hires/",
    headers={
        "Authorization": "Bearer <token>",
        "Rippling-Version": "2024-08-01",
        "Idempotency-Key": "ats-offer-1001"
    },
    json={
        "hires": [{
            "client_request_id": "ats-offer-1001",
            "hire_type": "direct_hire",
            "personal": {
                "first_name": "Jane",
                "last_name": "Doe",
                "invite_email": "jane.doe@example.com"
            },
            "work_location": {
                "location_id": "674c178fc3f93afc69715ef4",
                "country_code": "US"
            },
            "employment": {
                "title": "Software Engineer",
                "start_date": "2026-12-01",
                "employment_type_id": "674c1785c3f93afc69715d93",
                "legal_entity_id": "674c17a6c3f93afc6971617e",
                "resume_file_id": file_id
            },
            "compensation": {
                "base_pay_amount": {
                    "currency_type": "USD",
                    "value": 120000
                },
                "base_pay_period": "YEAR"
            }
        }]
    }
)
```

* * *

## FAQs

**Can I skip the confirm upload step?**

No. A tracker without `confirm-upload` stays in `awaiting_upload` status and is rejected by downstream APIs.

**What if my upload is interrupted?**

Both the S3 upload and `confirm-upload` are safe to retry. Create a fresh tracker ID by calling [POST Create a new file](https://developer.rippling.com/documentation/rest-api/reference/create-files) only if the 24-hour upload URL has expired.

**What happens if one document fails in a batch?**

Document failures are isolated per-document. One bad file does not abort other documents, the hire, or the batch. Check `document_results` in the response for per-document status.

**How do I handle network timeouts or failed uploads to employee folders?**

Always include a client-generated UUID in the `Idempotency-Key` header. The server uses this to deduplicate requests. If a request with an `Idempotency-Key` succeeds, subsequent retries with the same key safely return the original response rather than generating duplicate files. If you receive a `422 FOLDER_ACCESS_ERROR`, fix the input parameters and retry using a **new** key.

* * *

## See also

-   [Get started with the HRIS API](https://developer.rippling.com/documentation/rest-api/guides/hris-getting-started)
-   [Create and bulk hire draft hires](https://developer.rippling.com/documentation/rest-api/guides/drafthires)
-   [API tokens and permissions](https://developer.rippling.com/documentation/rest-api/essentials/api-tokens)

Source: https://developer.rippling.com/documentation/rest-api/guides/file-uploads

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
