---
title: "Upload an attachment"
method: POST
path: "/attachments"
tags: ["Attachments"]
---

# Upload an attachment

`POST /attachments`

Uploads a file as a task-level attachment.

Requires `workflowRunId` and `taskId` to identify the target task.
Accepts multipart form data (fields `workflowRunId` + `taskId` + `file`) or JSON with base64-encoded content
(fields `workflowRunId` + `taskId` + `fileBase64`). Maximum file size: 20 MB for multipart, 10 MB for base64.
You can also send `workflowRunId` + `taskId` + `fileUploadId` to attach a file you uploaded with
`createFileUpload`; the `fileUploadId` is single-use.

## Request body

- UploadAttachmentRequest
  - `workflowRunId` string, required — The ID of the Workflow Run.
  - `taskId` string, required — The ID of the Task.
  - `file` string, binary — Uploaded file reference. Use the upload endpoint to attach content.
  - `fileBase64` object
    - `content` string, required — Rich text content. May contain merge tags.
    - `filename` string, required
  - `fileUploadId` string

## Response `201`

- PublicApiAttachmentResponse
  - `data` object, required
    - `id` string, required — The resource's ID.
    - `createdDate` string, date-time, required — When the resource was first created. ISO-8601 UTC.
    - `createdBy` object, required — User who created the resource.
      - `id` string, required — The resource's ID.
      - `email` string, required — The user's email address (also their login identifier).
      - `username` string, required — The user's display name (e.g. `Jane Doe`).
    - `taskId` string, required — The ID of the Task
    - `workflowRunId` string, required — The ID of the Workflow Run
    - `workflowId` string, required — The ID of the Workflow
    - `fileName` string, required — Original filename as uploaded.
    - `mimeType` string, required — MIME type detected at upload time (e.g. `image/png`, `application/pdf`).
    - `size` integer, required — File size in bytes.
    - `links` object[] — Navigable HATEOAS links to related resources. Each entry has a `name` (RFC-5988 link relation like `self`, `edit`, `related`), an `href` URL, and a `type` (`Api` for callable endpoints, `App` for browser-facing URLs). Prefer following these `href` values over constructing URLs by hand.
      - `name` string, required — Standard link relation name (RFC 5988) indicating this link's role. Common values include `self`, `edit`, `related`, `previous`, `next`.
      - `href` string, required — URL of the linked resource.
      - `rel` 'Approval Task' | 'Approvals' | 'Assignees' | 'Comment' | 'Data Set Records' | 'Data Sets' | 'Form Field Values' | 'Subject Task' | 'Task' | 'Tasks' | 'Users' | 'Webhook' | 'Workflow' | 'Workflow Run' — Optional. The kind of resource this link points to (e.g. `Workflow`, `Task`, `Comment`).
      - `type` 'Api' | 'App', required — Whether this link targets an API endpoint or a Process Street app URL. `Api` — a callable API endpoint you can fetch directly. `App` — a browser-facing URL in the Process Street UI.
  - `links` object[] — Pagination links. When the result has more pages, look for an entry with `name: "next"` — its `href` is the URL to fetch the next page. Absence of `next` means there are no more pages. For single-resource responses this array is typically empty.
    - `name` string, required — Standard link relation name (RFC 5988) indicating this link's role. Common values include `self`, `edit`, `related`, `previous`, `next`.
    - `href` string, required — URL of the linked resource.
    - `rel` 'Approval Task' | 'Approvals' | 'Assignees' | 'Comment' | 'Data Set Records' | 'Data Sets' | 'Form Field Values' | 'Subject Task' | 'Task' | 'Tasks' | 'Users' | 'Webhook' | 'Workflow' | 'Workflow Run' — Optional. The kind of resource this link points to (e.g. `Workflow`, `Task`, `Comment`).
    - `type` 'Api' | 'App', required — Whether this link targets an API endpoint or a Process Street app URL. `Api` — a callable API endpoint you can fetch directly. `App` — a browser-facing URL in the Process Street UI.

## Other responses

- `400` — Invalid value
- `default`

---

[API](https://skmtc.net/process/apis/process-street-public-api.md) · [All operations](https://skmtc.net/process/apis/process-street-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/process/process-street-public-api/revisions/6199a9464227/schema)
