# Sandbox/tests

For context, we recommend reading how document creation and listing work first:

{% content-ref url="/pages/-LsYgNLWMNqAlDnd53uc" %}
[Creating a document](/api/mutations/criando-um-documento.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LsYgEpXilJyyGsfTnN1" %}
[Retrieving documents](/api/queries/resgatando-documentos.md)
{% endcontent-ref %}

### Creating Sandbox documents

Creating test documents only depends on a single attribute to be set in the document: `"sandbox"`.

```javascript
mutation CreateDocumentMutation(
  ...
) {
  createDocument(
    sandbox: true,
    document: $document,
    signers: $signers,
    file: $file
  ) {
  ...
  }
}
```

Done! Documents created with `"sandbox"` won’t consume credits, but since they are test documents, they will be deleted after a few days.

Until they are deleted, you can view them in the document listings on the dashboard if you enable the following option on the API keys page:

<figure><img src="/files/t7DNrLfFBXl8PSe06TMY" alt=""><figcaption></figcaption></figure>

### Retrieving Sandbox Documents

Just like in the dashboard, the document listing does **not** return sandbox documents by default.

To include them, you need to enable two specific flags.

**Enabling sandbox document listing**

To allow the listing to return documents created in sandbox mode, add the `showSandbox` flag in the query parameters:

```graphql
query {
  documents(
    limit: 60, 
    page: 1,
    showSandbox: true
  ) {
  ...
  }
}
```

**Listing only sandbox documents**

You can also retrieve **only** the documents created in sandbox mode. To do that, add the `onlySandbox` flag in the query parameters:

```graphql
query {
  documents(
    limit: 60, 
    page: 1,
    onlySandbox: true
  ) {
  ...
  }
}
```

{% hint style="info" %}
You can check what each of these parameters means directly in the full GraphQL API documentation, under the **Docs** tab in Altair. Not sure how to access it? Check out our tutorial: **Usando o Altair**.
{% endhint %}

{% hint style="warning" %}
If you're unsure how to send a document in your integration, this repository provides more information and examples on how to handle file uploads:

<https://github.com/jaydenseric/graphql-multipart-request-spec>
{% endhint %}

{% file src="/files/-M03o9cE5QB3vLoPUlzJ" %}
Para importar e usar no Postman
{% endfile %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autentique.com.br/api/integration-basics/sandbox-testes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
