{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Initiates a bulk export of resources for a workspace. The export will be processed asynchronously. Once the export has been requested, its progress can be monitored using the [jobs](/reference/getjob) endpoint.\n\n## Supported resource types\nThis endpoint currently supports exporting tasks, teams and messages within a workspace. Resources can be requested to be part of the export by providing the `export_request_parameters` parameter. The following resource types are supported:\n\n### Tasks:\nTasks are formatted for exports with some differences from their documented [schema](/reference/tasks):\n  - `attachments` are included by default and returns an array of associated attachments.\n  - Attachment objects do not include `download_url` or `view_url`. The `attachments` [endpoint](/reference/attachment) should be queried for up-to-date URLs.\n  - `stories` are included by default and returns an array of comments and other changes made to a task\n\n### Teams:\nTeams are formatted for exports with these differences from their documented [schema](/reference/teams):\n  - `members` are included by default and returns an array of Users that are members of the team\n  - Filtering is not supported for teams.\n\n### Messages:\nThe returned schema encompasses both default messages and status updates and is similar to the status update schema.\nThe available fields for messages are:\n  - `gid` - The globally unique identifier for the message.\n  - `resource_type` - The type of resource, which is always \"message\".\n  - `resource_subtype` - Optional. The subtype of the message, which can be \"default\" or \"status_update\".\n  - `status_type` - The type associated with the status update. This can be one of: “on_track”, “at_risk”, “off_track”, “on_hold”, “complete”, “achieved”, “partial”, “missed”, “dropped”\n  - `created_by` - The user who created the message.\n  - `created_at` - The time at which this resource was created and sent available to other users.\n  - `modified_at` - The time at which this resource was last modified.\n  - `title` - The title of the message.\n  - `text` - The text content of the message.\n  - `html_notes` - The text content of the message with formatting as HTML. Not included by default. Can be included by using “fields” in the initial request.\n  - `num_likes` - The number of users who have liked this message.\n  - `likes` - An array of users who have liked this message.\n  - `stories` - Optional. Array of stories applied to the message.\n  - `attachments` - Optional. Array of attachments added to the message.\n  - `followers` - Optional. Array of users currently following the message. Users that were sent the message are treated as followers.\n  - `parents` - Array of objects the message was sent to. Can be a Project, Portfolio, Team or Goal. Limited to a single object for status updates.\n\n\n## Export file\nThe final export file will be in JSON Lines format and compressed in a gzip container.\n\nObjects are formatted according to their corresponding API schema, or limited to the fields\nincluded in the `fields` parameter. Exports currently include undeleted objects.\n\nAn object in the export will be up to date anywhere between the exports `created_at` and `completed_at`. There is no guaranteed ordering of objects in the export.\n\nAccess to the export file expires 30 days after its completion.\n\n## Exporting specific fields\nBy default, each object in an export includes a predefined set of fields based on its schema. If a more limited set of fields\nor fields not included by default are required, the Export API allows for specifying which fields to include in the requested export.\n\nFields can be specified using the `fields` parameter. The fields parameter conforms to the fields\noptional parameter available for all Asana endpoints which is documented [here](https://developers.asana.com/docs/inputoutput-options).\n\nUtilizing the `fields` parameter is recommended if the full object is not required, especially when a large number of objects are being exported, to reduce the overall export time.\n\n## Filtering resources\nA disjunction of two or more filters can be achieved by providing multiple `export_request_parameters` for the same resource, each with different filters.\nHowever, this approach may result in duplicate resources being returned.\n\n## Rate Limits\nA workspace is currently limited to *one* in progress export request at a given time. The request will return with a 403 Forbidden status code if the limit is exceeded.","properties":{"body":{"type":"object","properties":{"data":{"$ref":"#/definitions/ResourceExportRequest"}}}},"required":["body"],"additionalProperties":false,"definitions":{"ResourceExportRequest":{"type":"object","description":"A *resource_export* request starts a job to bulk export objects for one or more resources.","properties":{"workspace":{"type":"string","description":"Gid of a workspace.","examples":["12345"]},"export_request_parameters":{"type":"array","description":"An object containing the parameters for the export request. The keys of this object are the GIDs of the resources to be exported. The values are objects with additional parameters for each resource.","items":{"$ref":"#/definitions/ResourceExportRequestParameter"}}}},"ResourceExportRequestParameter":{"type":"object","properties":{"resource_type":{"type":"string","description":"The type of the resource to be exported. This can be a task, team, or message.","examples":["task"]},"filters":{"$ref":"#/definitions/ResourceExportFilters"},"fields":{"type":"array","description":"An array of fields to include for the resource type. If not provided, all non-optional fields for the resource type will be included. This conforms to the fields optional parameter available for all Asana endpoints which is documented [here](https://developers.asana.com/docs/inputoutput-options)","items":{"type":"string","examples":["gid"]}}}},"ResourceExportFilters":{"type":"object","description":"Filters to apply to a resource that will be exported. These filters can be used to narrow down the resources that are included in the export.","properties":{"assigned_by.any":{"description":"Filter by the users who assigned the resource. This array accepts a list of user GIDs. This is only applicable to tasks.","type":"array","items":{"type":"string","examples":["12345"]}},"assignee.any":{"description":"Filter by the users who are assigned to the resource. This array accepts a list of user GIDs. This is only applicable to tasks.","type":"array","items":{"type":"string","examples":["12345"]}},"commented_on_by.any":{"description":"Filter by the users who commented on the resource. This array accepts a list of user GIDs.","type":"array","items":{"type":"string","examples":["12345"]}},"created_at.after":{"description":"Filter results to resources created after a specified date and time.","type":"string","format":"date-time","examples":["2023-01-01T00:00:00Z"]},"created_at.before":{"description":"Filter results to resources created before a specified date and time.","type":"string","format":"date-time","examples":["2023-01-01T00:00:00Z"]},"created_by.any":{"description":"Filter by the users who created the resource. This array accepts a list of user GIDs.","type":"array","items":{"type":"string","examples":["12345"]}},"followers.any":{"description":"Filter by the users who are following the resource. This array accepts a list of user GIDs.","type":"array","items":{"type":"string","examples":["12345"]}},"liked_by.any":{"description":"Filter by the users who liked the resource. This array accepts a list of user GIDs.","type":"array","items":{"type":"string","examples":["12345"]}},"modified_at.after":{"description":"Filter results to resources modified after a specified date and time.","type":"string","format":"date-time","examples":["2023-01-01T00:00:00Z"]},"modified_at.before":{"description":"Filter results to resources modified before a specified date and time.","type":"string","format":"date-time","examples":["2023-01-01T00:00:00Z"]}}}}},"name":"Initiate a resource export","id":"asana.createresourceexport","example":{"body":{}},"maxRequests":1,"summary":false}}