# Adding Documents

Datasaur supports adding documents into an existing project, as described [here](https://docs.datasaur.ai/data-studio-projects/adding-documents-to-an-ongoing-project).

In this section, we'll be running through how to do this programmatically via our API, specifically through GraphQL mutation [addDocumentsToProject](https://api-docs.datasaur.ai/#mutation-addDocumentsToProject).

1. Make sure you have generated your [OAuth Credentials](https://docs.datasaur.ai/api/credentials). These are crucial for authentication and gaining access to the API capabilities.
2. Prepare the GraphQL payload which will be used for the API request. Below is a simplified version of the payload required for adding documents to a project. You can access the complete reference [here](https://api-docs.datasaur.ai/#definition-AddDocumentsToProjectInput).
3. Send the GraphQL request to submit your request. Upon successfully submitting your mutation, you will receive a `Job ID`. This ID can be used to monitor the progress.

```json
{
  "operationName": "AddDocumentsToProjectMutation",
  "query": "mutation AddDocumentsToProjectMutation($input: AddDocumentsToProjectInput!) {\n  result: addDocumentsToProject(input: $input) {\n    job {\n      ...JobFragment\n      __typename\n    }\n    name\n    __typename\n  }\n}\n\nfragment JobFragment on Job {\n  id\n  status\n  progress\n  errors {\n    id\n    stack\n    args\n    __typename\n  }\n  resultId\n  createdAt\n  updatedAt\n  result\n  additionalData {\n    documentIds\n    __typename\n  }\n  __typename\n}\n",
  "variables": {
    "input": {
      "documents": [
        {
          "document": {
            "name": "<FILENAME>",
            "objectKey": "<PATH_TO_FILE>"
          }
        }
      ],
      "projectId": "<PROJECT ID>"
    }
  }
}
```

The `documents` structure follows the same format as used in the `createProject` mutation. [Read more here](https://example.com/createProject-documentation) for document details.

{% hint style="info" %}
Currently, we don't have an example API client. If you require more personalized support or guidance, please reach out to us at <support@datasaur.ai>.
{% endhint %}
