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 Altairarrow-up-right:

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:

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

Then test it in Altairarrow-up-right like this:

circle-info

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.

circle-info

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

circle-info

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/arrow-up-right

Para importar e usar no Postman

Last updated