---
title: "Add attachments to a Lead"
method: POST
path: "/v2/leads/{id}/attachments"
tags: ["Leads"]
---

# Add attachments to a Lead

`POST /v2/leads/{id}/attachments`

## Request

- Base URL: `https://api.workiz.com/crm/api`
- URL: `https://api.workiz.com/crm/api/v2/leads/{id}/attachments`
- Auth: none declared. Required headers: `Authorization`
- TypeScript: <https://skmtc.dev/workiz/apis/developer-api/docs/v2/leads/:id/attachments/post.ts> (a function with typed inputs; its response is checked against the schema)

> **Beta:** Breaking changes may occur without notice.

Stores files in Workiz and attaches them to the Lead. Send either `multipart/form-data` with the files in the `files` field, or JSON with public URLs in `attachments`, which Workiz downloads during the request. Do not send both. The file type is taken from the file name or URL extension; for a URL without one, set `type`. URLs that resolve to private or internal network addresses are rejected. The request is all or nothing: if any file is invalid or cannot be downloaded, none are added.

## Path parameters

- `id` string, required

## Headers

- `Authorization` string, required

## Request body

- CreateGenericAttachmentsV2Dto
  - `attachments` CreateGenericAttachmentV2Dto[]: A list of files to download from public URLs and attach, up to 5 per request and 24 MB combined. Required for JSON requests.
    - `fileUrl` string, required: The public HTTPS URL of the file. The file is downloaded and stored by Workiz, so the URL only needs to be reachable during the request.
    - `type` 'pdf' | 'jpeg' | 'jpg' | 'jpe' | 'png' | 'gif' | 'webp' | 'doc' | 'docx' | 'xls' | 'xlsx' | 'csv': The file type. Only used when the URL path has no file extension; otherwise the extension wins.
    - `name` string: The display name for the attachment. Defaults to the name in the URL.

## Response `201`

The created attachments.

- ResponseGenericAttachmentV2Dto[]
  - `id` string: The ID of the attachment (prefix `FLE-`).
  - `name` string: The name of the attachment.
  - `fileUrl` string: The URL of the attachment.

## Other responses

- `400`: Invalid input: no files or URLs, both sent, too many files, an empty file, a malformed or disallowed URL, a file type that is not allowed, or a file that could not be downloaded.
- `401`: Missing or invalid authentication token.
- `403`: The API key does not have permission to access this resource.
- `404`: Lead not found.
- `413`: The attachments exceed the combined size limit of 24 MB.
- `429`: Rate limit exceeded.

## Changes

- **2026-11-10** `bb1c25c92b05`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/workiz/apis/developer-api/changes/v2/leads/:id/attachments/post.md)

---

[API](https://skmtc.dev/workiz/apis/developer-api.md) - [All operations](https://skmtc.dev/workiz/apis/developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/workiz/apis/developer-api/revisions/fb557783146c?raw)
