---
title: "To attach one or more files to the record"
method: POST
path: "/api/Public/attachfiles"
tags: ["Public"]
---

# To attach one or more files to the record

`POST /api/Public/attachfiles`

## Request

- Base URL: `https://apidocs.cflowapps.com` (the document declares no server; this is the origin it was published from)
- URL: `https://apidocs.cflowapps.com/api/Public/attachfiles`
- Auth: API key in header `X-Api-Key` and API key in header `X-User-Key`
- TypeScript: <https://skmtc.dev/cflowapps/apis/cflow-public-api/docs/api/Public/attachfiles/post.ts> (a function with typed inputs; its response is checked against the schema)

Sample request:
            
    POST 
    {
         "Files":"Files to upload"
         "WorkflowName":"Test Workflow",
         "StageName":"Approval stage",
         "RecordId":"10",
         "Description":"Description of the attached file"
    }

## Request body `multipart/form-data`

- object
  - `Files` string[], required: List of files to upload (Maximum File Size 20MB)
  - `WorkflowName` string, required: Name of the workflow
  - `StageName` string, required: Name of the stage
  - `RecordId` integer, required: Record Id
  - `Description` string: Description of the files

## Response `200`

File upload status

- FileAttachStatus[]
  - `fileName` string, nullable: Attached Filename
  - `status` string, nullable: Returns if the file is uploaded successfully
  - `message` string, nullable: Message of the file

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Unable to attach files
- `500`: Internal Server Error

---

[API](https://skmtc.dev/cflowapps/apis/cflow-public-api.md) - [All operations](https://skmtc.dev/cflowapps/apis/cflow-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cflowapps/apis/cflow-public-api/revisions/af0dadd0ad10?raw)
