Moving document to a folder
How to move a document to a folder
To move a document to a folder, use the following mutation:
mutation {
  moveDocumentToFolder(
    document_id: "DOCUMENT_ID",
    folder_id: "FOLDER_DESTINATION_ID"
  )
}And finally, testing this mutation in Altair:

If your document is already in a folder, you need to provide the parameter corresponding to its current folder using the current_folder_id attribute.
mutation {
  moveDocumentToFolder(
    document_id: "DOCUMENT_ID",
    current_folder_id: "CURRENT_FOLDER_ID",
    folder_id: "FOLDER_DESTINATION_ID"
  )
}If you need to file a document into a group or organization folder, you'll also need to use the context attribute.
mutation {
  moveDocumentToFolder(
    document_id: "DOCUMENT_ID",
    folder_id: "FOLDER_DESTINATION_ID",
    context: ORGANIZATION # For organization folders, GROUP for group folders
  )
}Lastly, to remove a document from a folder, set folder_id to null.
mutation {
  moveDocumentToFolder(
    document_id: "DOCUMENT_ID",
    folder_id: null
  )
}Last updated
Was this helpful?