Attachments

An attachment object represents any file attached to a task in Asana, whether it’s an uploaded file or one associated via a third-party service such as Dropbox or Google Drive.


AttachmentCompact

A Compact object reflects the default fields returned after a successful API request. See input/output options to include more fields in the response.

PropertyTypeDescription
gidstringGlobally unique identifier of the resource, as a string.
resource_typestringThe base type of this resource.
namestringThe name of the file.
resource_subtypestringThe service hosting the attachment. Valid values are asana, dropbox, gdrive, onedrive, box, vimeo, and external.
{
  "gid": "12345",
  "resource_type": "attachment",
  "name": "Screenshot.png",
  "resource_subtype": "dropbox"
}

AttachmentCompact

PropertyTypeDescription
gidstringGlobally unique identifier of the resource, as a string.
resource_typestringThe base type of this resource.
namestringThe name of the file.
resource_subtypestringThe service hosting the attachment. Valid values are asana, dropbox, gdrive, onedrive, box, vimeo, and external.

Example JSON for AttachmentCompact:

{
  "gid": "12345",
  "resource_type": "attachment",
  "name": "Screenshot.png",
  "resource_subtype": "dropbox"
}

Attachment

PropertyTypeDescription
gidstringGlobally unique identifier of the resource, as a string.
resource_typestringThe base type of this resource.
namestringThe name of the file.
resource_subtypestringThe service hosting the attachment. Valid values are asana, dropbox, gdrive, onedrive, box, vimeo, and external.
created_atstring (date-time)The time at which this resource was created.
download_urlstring (uri)The URL containing the content of the attachment. Note: May be null if the attachment is hosted by Box and will be null if the attachment is a Video Message hosted by Vimeo. If present, this URL may only be valid for two minutes from the time of retrieval. You should avoid persisting this URL somewhere and just refresh it on demand to ensure you do not keep stale URLs.
permanent_urlstring (uri)
hoststringThe service hosting the attachment. Valid values are asana, dropbox, gdrive, box, and vimeo.
parentobjectThe task this attachment is attached to.
parent.gidstringGlobally unique identifier of the resource, as a string.
parent.resource_typestringThe base type of this resource.
parent.namestringThe name of the task.
parent.resource_subtypestringThe resource subtype of the parent resource that the filter applies to.
parent.created_byobjectOpt In. A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.
parent.created_by.gidstringGlobally unique identifier of the resource.
parent.created_by.resource_typestringThe type of resource.
sizeintegerThe size of the attachment in bytes. Only present when the resource_subtype is asana.
view_urlstring (uri)The URL where the attachment can be viewed, which may be friendlier to users in a browser than just directing them to a raw file. May be null if no view URL exists for the service.
connected_to_appbooleanWhether the attachment is connected to the app making the request for the purposes of showing an app components widget. Only present when the resource_subtype is external or gdrive.

Example JSON for Attachment:

{
  "gid": "12345",
  "resource_type": "attachment",
  "name": "Screenshot.png",
  "resource_subtype": "dropbox",
  "created_at": "2012-02-22T02:06:58.147Z",
  "download_url": "https://s3.amazonaws.com/assets/123/Screenshot.png",
  "permanent_url": "https://s3.amazonaws.com/assets/123/Screenshot.png",
  "host": "dropbox",
  "parent": {
    "gid": "12345",
    "resource_type": "task",
    "name": "Bug Task",
    "resource_subtype": "default_task",
    "created_by": {
      "gid": "1111",
      "resource_type": "user"
    }
  },
  "size": 12345,
  "view_url": "https://www.dropbox.com/s/123/Screenshot.png",
  "connected_to_app": true
}
Asana Home
Asana helps you manage projects, focus on what's important, and organize work in one place for seamless collaboration.
© 2023 Asana, Inc.