younifyd
Menu

Export

Export Data to a File

POST/utils/export/{collection}

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Export action (under Utilities).
  3. Fill in the fields below, then reference the result from later steps as {{export.response.data}}.

Request

Path parameters

collectionstringrequired

Collection identifier

Request body

Enter the body as JSON in the step's Body field.

formatstringrequired

What file format to save the export to. One of `csv`, `csv_utf8`, `xml`, `json`, `yaml`

One ofcsvcsv_utf8xmljsonyaml

queryobjectrequired
fieldsarray<string>

Control what fields are being returned in the object.

filterobject
searchstring

Filter by items that contain the given search query in one of their fields.

sortarray<string>

How to sort the returned items.

limitnumber

Set the maximum number of items that will be returned

offsetnumber

How many items to skip when fetching data.

pagenumber

Cursor for use in pagination. Often used in combination with limit.

deepobject

Deep allows you to set any of the other query parameters on a nested relational dataset.

backlinkboolean

Retrieve relational items excluding reverse relations when using wildcard fields.

fileobjectrequired
typeany
descriptionany
json
{
  "format": "csv",
  "query": {
    "fields": [
      "*",
      "*.*"
    ],
    "filter": {
      "<field>": {
        "<operator>": "<value>"
      }
    },
    "search": "string",
    "sort": [
      "-date_created"
    ],
    "limit": 0,
    "offset": 0,
    "page": 0,
    "deep": {
      "related_articles": {
        "_limit": 3
      }
    },
    "backlink": false
  },
  "file": {
    "type": null,
    "description": null
  }
}

Response

Returns 200 with a any. Read it in later steps with {{export.response.data.<field>}}.

Need more? See the Directus guide for connection setup and behaviour shared by every action.