---
updatedAt: 2026-07-01T21:23:16.000Z
agentTools:
  projectIndex: https://developer.clickup.com/llms.txt
---

# Create an Attachment

Upload an attachment to a task or to a file type Custom Field. \
 \
Once a file has been uploaded to a `custom_fields` entity, use [Set Custom Field Value](ref:SetCustomFieldValue) to associate the uploaded file with a task. \
 \
To retrieve the ID of a Custom Field, you can use [Get List Custom Fields](red:GetAccessibleCustomFields) or [Get task](ref:GetTask).

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "ClickUp Public API v3",
    "version": "version",
    "description": "This API is exposed to the public internet and is meant to be accessed by third-party integrations."
  },
  "servers": [
    {
      "url": "https://api.clickup.com/",
      "description": "ClickUp"
    }
  ],
  "paths": {
    "/api/v3/workspaces/{workspace_id}/{entity_type}/{entity_id}/attachments": {
      "post": {
        "operationId": "postEntityAttachment",
        "summary": "Create an Attachment",
        "description": "Upload an attachment to a task or to a file type Custom Field. \\\n \\\nOnce a file has been uploaded to a `custom_fields` entity, use [Set Custom Field Value](ref:SetCustomFieldValue) to associate the uploaded file with a task. \\\n \\\nTo retrieve the ID of a Custom Field, you can use [Get List Custom Fields](red:GetAccessibleCustomFields) or [Get task](ref:GetTask).",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "description": "The ID of the Workspace.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AttachmentsPublicApiAttachmentsControllerPostEntityAttachmentWorkspaceIdPath"
            }
          },
          {
            "name": "entity_type",
            "in": "path",
            "description": "The entity type. Options include `attachments` for tasks or `custom_fields` for a Files Custom Field.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AttachmentsPublicApiAttachmentsControllerPostEntityAttachmentEntityTypePath"
            }
          },
          {
            "name": "entity_id",
            "in": "path",
            "description": "The ID of the task or Custom Field.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentsPublicPostAttachmentBodyParamsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created attachment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentsAttachment"
                }
              }
            }
          },
          "400": {
            "description": "Returns when {entityType} is not 'custom_fields'",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentsPublicApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Returns when {entityId} not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentsPublicApiErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Generic Error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentsPublicApiErrorResponse"
                }
              }
            }
          }
        },
        "tags": [
          "Attachments"
        ],
        "x-is-workspace-endpoint": true
      }
    }
  },
  "components": {
    "schemas": {
      "AttachmentsAttachment": {
        "type": "object",
        "properties": {
          "date_updated": {
            "description": "The date & time the attachment was updated (Unix epoch milliseconds timestamp).",
            "type": "integer",
            "example": 1737065673712
          },
          "date_created": {
            "description": "The date & time the attachment was created (Unix epoch milliseconds timestamp).",
            "type": "integer",
            "example": 1737065673712
          },
          "extension": {
            "description": "The extension of the attachment.",
            "type": "string",
            "example": "png"
          },
          "id": {
            "description": "The ID of the attachment.",
            "type": "string",
            "example": "51971815-ae25-49d5-b90c-4988f400a307.png"
          },
          "mime_type": {
            "description": "The MIME type of the attachment.",
            "type": "string",
            "example": "image/png"
          },
          "parent_entity_type": {
            "description": "The type of entity the attachment belongs to.",
            "type": "string",
            "example": "tasks",
            "enum": [
              "attachments",
              "comments",
              "custom_fields",
              "docs",
              "posts",
              "reminders",
              "tasks",
              "widgets",
              "views"
            ]
          },
          "parent_id": {
            "description": "The ID of the entity the attachment belongs to.",
            "type": "string"
          },
          "size": {
            "description": "The size in bytes of the attachment.",
            "type": "integer",
            "example": 14697
          },
          "signed": {
            "description": "The signed status of the attachment.",
            "type": "boolean",
            "example": true
          },
          "thumbnail_small": {
            "description": "The small size thumbnail url of the attachment.",
            "type": "string",
            "format": "uri"
          },
          "thumbnail_medium": {
            "description": "The medium size thumbnail url of the attachment.",
            "type": "string",
            "format": "uri"
          },
          "thumbnail_large": {
            "description": "The large size thumbnail url of the attachment.",
            "type": "string",
            "format": "uri"
          },
          "title": {
            "description": "The attachment title.",
            "type": "string",
            "example": "An example image"
          },
          "url": {
            "description": "The url of the attachment.",
            "type": "string",
            "format": "uri"
          },
          "user_id": {
            "description": "The ID of the user who created the attachment.",
            "type": "integer"
          }
        },
        "required": [
          "date_updated",
          "date_created",
          "extension",
          "id",
          "mime_type",
          "parent_entity_type",
          "parent_id",
          "size",
          "signed",
          "thumbnail_small",
          "thumbnail_medium",
          "thumbnail_large",
          "title",
          "url",
          "user_id"
        ]
      },
      "AttachmentsPublicApiErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "description": "The HTTP Status code for the error",
            "type": "integer"
          },
          "message": {
            "description": "The message describing the error",
            "type": "string",
            "example": "Generic error message"
          },
          "trace_id": {
            "description": "Unique trace ID for tracking the request. Used for troubleshooting errors",
            "type": "integer",
            "example": 123456789,
            "nullable": true
          },
          "timestamp": {
            "description": "The time of the error (Unix epoch milliseconds timestamp).",
            "type": "integer",
            "example": 1671534256138
          }
        },
        "required": [
          "status",
          "message",
          "trace_id",
          "timestamp"
        ]
      },
      "AttachmentsPublicApiAttachmentsControllerPostEntityAttachmentWorkspaceIdPath": {
        "type": "integer"
      },
      "AttachmentsPublicApiAttachmentsControllerPostEntityAttachmentEntityTypePath": {
        "type": "string",
        "enum": [
          "attachments",
          "custom_fields"
        ]
      },
      "AttachmentsPublicPostAttachmentBodyParamsDto": {
        "type": "object",
        "properties": {
          "filename": {
            "description": "Override the filename of the attachment",
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "authHeader": {
        "in": "header",
        "type": "apiKey",
        "name": "Authorization"
      }
    }
  },
  "tags": [
    {
      "description": "Attachments API",
      "name": "Attachments"
    }
  ],
  "security": [
    {
      "authHeader": []
    }
  ]
}
```