---
title: "Adds a File Attachment to a Record"
method: POST
path: "/{objectName}/{id}/FileAttachments"
tags: ["CustomObjectsRecords"]
---

# Adds a File Attachment to a Record

`POST /{objectName}/{id}/FileAttachments`

## Request

- Base URL: `https://api.insightly.com/v3.1`
- URL: `https://api.insightly.com/v3.1/{objectName}/{id}/FileAttachments`
- Auth: none declared. Required headers: `Authorization`

This endpoint expects multipart/form-data as the request payload. See Stack Overflow for examples of how to generate multipart requests, or see our <a href="http://github.com/Insightly" target="_blank">client libraries</a> for an example of how this is generated. Only one file can be added per request. Some file types are not allowed for security reasons.

## Path parameters

- `objectName` string, required
- `id` integer, required

## Headers

- `Authorization` string, required

## Request body `multipart/form-data`

- object
  - `file_name` string
  - `content_type` string
  - `file_category_id` integer

## Response `201`

Request succeeded.

- object
  - `RECORD_ID` integer
  - `RECORD_NAME` string, string, required
  - `OWNER_USER_ID` integer
  - `DATE_CREATED_UTC` string, date-time
  - `VISIBLE_TO` string, string
  - `VISIBLE_TEAM_ID` integer
  - `CUSTOMFIELDS` APICustomField[]
    - `FIELD_NAME` string
    - `FIELD_VALUE` object

## Other responses

- `400`: Data validation error.
- `401`: Authentication failed.
- `402`: Record or storage limit reached.
- `403`: API User does not have access to Record.
- `404`: Record not found.
- `417`: File Attachment insert failed.

---

[API](https://skmtc.dev/insightly/apis/insightly-api-v3-1.md) - [All operations](https://skmtc.dev/insightly/apis/insightly-api-v3-1/llms.txt) - [OpenAPI document](https://skmtc.dev/insightly/apis/insightly-api-v3-1/revisions/e7df0c3b65fb?raw)
