> ## Documentation Index
> Fetch the complete documentation index at: https://developers.wrike.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Attachment (Task)

Add an attachment to a task.

<b>Scopes:</b> Default, wsReadWrite

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Wrike API",
    "version": "4.0"
  },
  "servers": [
    {
      "url": "https://www.wrike.com/api/v4"
    },
    {
      "url": "https://app-eu.wrike.com/api/v4"
    },
    {
      "url": "https://app-us2.wrike.com/api/v4"
    }
  ],
  "paths": {
    "/tasks/{taskId}/attachments": {
      "post": {
        "tags": [
          "Attachments"
        ],
        "summary": "Create Attachment (Task)",
        "description": "Add an attachment to a task.\n\n<b>Scopes:</b> Default, wsReadWrite",
        "operationId": "POST:/tasks/single/attachments",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TaskId"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Attachment"
                      }
                    },
                    "kind": {
                      "$ref": "#/components/schemas/ResponseKind"
                    }
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "client-side error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "server-side error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTP": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ResponseKind": {
        "type": "string",
        "enum": [
          "accounts",
          "users",
          "contacts",
          "assets",
          "eDiscoveryReport",
          "folders",
          "folderTree",
          "tasks",
          "taskIds",
          "timelogs",
          "timelogCategories",
          "timelogLockPeriods",
          "timetrackerTimers",
          "comments",
          "attachments",
          "url",
          "version",
          "dataExport",
          "dataExportSchema",
          "auditLog",
          "accessRoles",
          "stream",
          "changes",
          "posts",
          "mailSettings",
          "integrationInfo",
          "gmailIntegrationSettings",
          "workTypesForIntegrations",
          "ids",
          "backups",
          "domains",
          "dependencies",
          "workflows",
          "workschedules",
          "workscheduleExclusions",
          "workscheduleUserExclusions",
          "customfields",
          "customfieldIds",
          "customstatuses",
          "invitations",
          "notifications",
          "jobroles",
          "placeholders",
          "groups",
          "session",
          "dashboards",
          "widgets",
          "taskCreationSettings",
          "colors",
          "experiments",
          "topics",
          "topicComments",
          "webhooks",
          "reviews",
          "boards",
          "textSearch",
          "chatChannels",
          "chatMessages",
          "forms",
          "requestForms",
          "request",
          "report",
          "platformWidgets",
          "platformWidgetInstances",
          "spaces",
          "pdf",
          "customerSatisfaction",
          "asyncJob",
          "approvals",
          "highlights",
          "highlightsList",
          "highlightsSettings",
          "highlightsCard",
          "timesheet",
          "timesheetRow",
          "timesheetSubmissionRule",
          "mobileFeatures",
          "mobileSettings",
          "folderBlueprintTree",
          "taskBlueprintTree",
          "feedback",
          "timeline_snapshot",
          "contactIds",
          "bookings",
          "integrateThreshold",
          "hourlyRatesProvision",
          "hourlyRates",
          "projectTeamMembers",
          "contactsHistory",
          "tasksHistory",
          "foldersHistory",
          "activityDigest",
          "workItemTemplates",
          "workTemplates",
          "workItemMetadata",
          "workItem",
          "customItemTypes",
          "verificationCode",
          "views",
          "listView",
          "tableView",
          "userTypes",
          "reactions",
          "externalRequesters",
          "workscheduleCapacityOverrides",
          "userCapacityOverrides",
          "userCapacityExclusions",
          "rollups",
          "requestFormPrefill",
          "cascadingFieldSettings"
        ]
      },
      "ErrorType": {
        "type": "string",
        "enum": [
          "invalid_request",
          "invalid_parameter",
          "parameter_required",
          "not_authorized",
          "access_forbidden",
          "not_allowed",
          "resource_not_found",
          "method_not_found",
          "too_many_requests",
          "rate_limit_exceeded",
          "server_error"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errorDescription": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorType"
          }
        }
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "currentAttachmentId": {
            "$ref": "#/components/schemas/AttachmentId"
          },
          "originVersionId": {
            "$ref": "#/components/schemas/AttachmentId"
          },
          "reviewIds": {
            "type": "array",
            "description": "Review IDs",
            "items": {
              "$ref": "#/components/schemas/ReviewId"
            }
          },
          "previewUrl": {
            "type": "string",
            "description": "Link to download external attachment preview (present if preview is available)"
          },
          "playlistUrl": {
            "type": "string",
            "description": "Link to video playlist"
          },
          "authorId": {
            "$ref": "#/components/schemas/UserId"
          },
          "type": {
            "$ref": "#/components/schemas/AttachmentType"
          },
          "version": {
            "type": "number",
            "description": "Attachment version"
          },
          "folderId": {
            "type": "string",
            "description": "ID of related folder. Only one of taskId/folderId fields is present"
          },
          "url": {
            "type": "string",
            "description": "Link to download attachment"
          },
          "createdDate": {
            "type": "string",
            "description": "Upload date<br>Format: yyyy-MM-dd'T'HH:mm:ss'Z'"
          },
          "size": {
            "type": "number",
            "description": "Size for Wrike Attachments. For external attachments, size is equal to -1"
          },
          "name": {
            "type": "string",
            "description": "Attachment filename"
          },
          "width": {
            "type": "number",
            "description": "Attachment width, if image"
          },
          "commentId": {
            "type": "string",
            "description": "ID of related comment"
          },
          "id": {
            "$ref": "#/components/schemas/AttachmentId"
          },
          "contentType": {
            "type": "string",
            "description": "Content type"
          },
          "taskId": {
            "type": "string",
            "description": "ID of related task. Only one of taskId/folderId fields is present"
          },
          "height": {
            "type": "number",
            "description": "Attachment height, if image"
          }
        }
      },
      "AttachmentType": {
        "type": "string",
        "description": "* `Google` - Google attachment. Attachment can be accessed only via URL, downloads are not supported by Wrike.When deleted, only stored link is removed\n* `DAM` - Attachment from an external DAM system\n* `OneDrive` - OneDrive attachment. When deleted, only stored link is removed\n* `Wrike` - Attachment file content stored in Wrike. When deleted, actual file is removed\n* `External` - External attachment\n* `Box` - Box attachment. Attachment can be accessed only via URL, downloads are not supported by Wrike.When deleted, only stored link is removed\n* `SharePoint` - SharePoint attachment. When deleted, only stored link is removed\n* `DropBox` - DropBox attachment. When deleted, only stored link is removed",
        "enum": [
          "Google",
          "DAM",
          "OneDrive",
          "Wrike",
          "External",
          "Box",
          "SharePoint",
          "DropBox"
        ]
      },
      "ReviewId": {
        "pattern": "^([A-Z0-9]){16}$",
        "type": "string"
      },
      "TaskId": {
        "pattern": "^([a-zA-Z0-9-_:\\.=]){1,256}$",
        "type": "string"
      },
      "AttachmentId": {
        "pattern": "^([A-Z0-9]){16}$",
        "type": "string"
      },
      "UserId": {
        "pattern": "^([A-Z0-9]){8}$",
        "type": "string"
      }
    },
    "securitySchemes": {
      "HTTP": {
        "type": "http",
        "description": "Use OAuth 2.0 access token or permanent access token for authorization.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```