Creating folders

How to create a regular or shared folder with the organization

Creating a regular folder

The mutation to create a folder in the authenticated user’s account (owner of the API token) is:

mutation CreateFolderMutation($folder: FolderInput!) {
  createFolder(folder: $folder) {
    id
    name
    type
    created_at
  }
}

Define the variable values:

{
  "folder": {
    "name": "Signed contracts"
  }
}

And testing this mutation in Altair:

Creating a shared folder

Compared to the mutation used to create folders, the only difference is the type parameter. So, by reusing almost the same mutation, just include the parameter:

mutation SharedFolderMutation(
  $folder: FolderInput!,
  $type: FolderTypeEnum
) {
  createFolder(folder: $folder, type: $type) {
    id
    name
    type
    created_at
  }
}

And this time, by setting the value of the type parameter to ORGANIZATION:

{
  "folder": {
    "name": "Shared contracts"
  },
  "type": "ORGANIZATION"
}

Then test it in Altair like this:

If you want to create a document inside a folder, use the folder_id attribute when creating the document. If your goal is to add an existing document to another folder that has already been created, see how to move a document to a folder.

You can check what each of these parameters means directly in the full GraphQL API documentation, in the Docs menu of Altair. If you're not sure how to do that, check out our tutorial on Using Altair.

If Altair doesn't help you integrate with the API, check out some examples of how to make these requests in other ways: https://graphql.org/graphql-js/graphql-clients/

Para importar e usar no Postman

Last updated

Was this helpful?