# Add evidence for workflow check

This cookbook explains how to upload **evidence for a workflow check** configured in your Sprinto account using the Sprinto Developer API.

Uploading evidence allows you to satisfy control requirements linked to workflow checks and move them towards compliance. This process involves two steps:

1. Retrieve the workflow check UUID.
2. Upload evidence for the selected workflow check.

Both steps are performed using GraphQL operations.

***

### Before you begin

Ensure that you have:

* A valid **API key**
* Access to the Sprinto API Playground (if using the playground)
* At least one **active workflow check**
* An **evidence file** to upload
* The **evidence record date**

***

### API status

The Sprinto Developer API is currently in beta.

* Endpoints and schema fields may change as new functionality is introduced.

***

### Step 1: Get the workflow check UUID

To upload evidence, you first need the **UUID (`pk`)** of the workflow check.

#### Query workflow checks

Use the following query to retrieve workflow checks from your Sprinto account.

{% tabs %}
{% tab title="Query" %}

```graphql
query WorkflowChecksPaginated($first: Int) {
  workflowChecksPaginated(first: $first) {
    totalCount
    edges {
      node {
        pk
        title
      }
      cursor
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "data": {
    "workflowChecksPaginated": {
      "totalCount": 107,
      "edges": [
        {
          "node": {
            "pk": "dasdfadfsdsfsdfvcssdfvsC",   // This is a dummy value
            "title": "Performance Evaluations"
          },
          "cursor": "E48QH8ESAIJFNOAINCOMDFSD"          // This is a dummy value
        },
        {
          "node": {
            "pk": "dsfSCsdfcsaXcsdfcsdcc",      // This is a dummy value
            "title": "Periodic review of the users having access to  trello"
          },
          "cursor": "dfsfdsf90w3rejdiwefioaDFC"        // This is a dummy value
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

**Try yourself**: [United States](https://app.sprinto.com/dev-api/explorer): [Europe](https://eu.sprinto.com/dev-api/explorer): [India](https://in.sprinto.com/dev-api/explorer)

Copy the `pk` value of the workflow check for which you want to upload evidence.

#### Pagination note

If the required workflow check is not returned:

* Use the `after` argument with the `cursor` value from the previous response.
* Refer to the Pagination documentation for details.

***

### Step 2: Upload evidence for the workflow check

Once you have the workflow check UUID, use the following mutation to upload evidence.

***

### Mutation: `uploadWorkflowCheckEvidence`

#### Input arguments

<table><thead><tr><th width="184.84375">Argument</th><th width="123.296875">Type</th><th width="107.3203125">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>workflowCheckPk</code></td><td>UUID</td><td>Yes</td><td>UUID of the workflow check</td></tr><tr><td><code>evidenceRecordDate</code></td><td>DateTime</td><td>Yes</td><td>Date the evidence was recorded (YYYY-MM-DD)</td></tr><tr><td><code>evidenceFile</code></td><td>Upload</td><td>Yes</td><td>Evidence file to upload</td></tr></tbody></table>

***

### Example mutation

{% tabs %}
{% tab title="Query" %}

```graphql
mutation UploadWorkflowCheckEvidence($workflowCheckPk: UUID!, $evidenceRecordDate: DateTime!, $evidenceFile: Upload!) {
  uploadWorkflowCheckEvidence(workflowCheckPk: $workflowCheckPk, evidenceRecordDate: $evidenceRecordDate, evidenceFile: $evidenceFile) {
    workflowCheck {
      evidenceStatus
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```python
{
  "data": {
    "uploadWorkflowCheckEvidence": {
      "message": "Evidence uploaded for this check",
      "workflowCheck": {
        "evidenceStatus": "UPLOAD_COMPLETE"
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

**Try yourself**: [United States](https://app.sprinto.com/dev-api/explorer): [Europe](https://eu.sprinto.com/dev-api/explorer): [India](https://in.sprinto.com/dev-api/explorer)

***

### Uploading files in the API Playground

When using the Sprinto API Playground:

1. In the **Variables** section, add the key `evidenceFile`.
2. Select **Choose files** and upload the evidence file from your computer.
3. Ensure the file key matches the mutation argument name exactly.

***

### Supported file formats

The following file formats are supported for evidence uploads:

* `.doc`, `.docx`, `.dotx`
* `.xls`, `.xlsx`
* `.pdf`
* `.zip`, `.tar`
* `.odt`, `.ods`

Uploading unsupported file formats results in an error.

***

### Response codes and errors

The following response codes may be returned for this operation:

<table><thead><tr><th width="129.609375">Status code</th><th width="126.015625">Status</th><th width="247.52734375">Message</th><th>Reason</th></tr></thead><tbody><tr><td>200</td><td>Success</td><td>Evidence uploaded for this check.</td><td>The evidence was uploaded successfully.</td></tr><tr><td>200</td><td>Error</td><td>Incorrect check ID, evidence cannot be uploaded.</td><td>The workflow check UUID is invalid.</td></tr><tr><td>200</td><td>Error</td><td>The check is in review, so evidence cannot be uploaded.</td><td>Evidence can be uploaded only after review is completed.</td></tr><tr><td>200</td><td>Error</td><td>Unable to upload this file format.</td><td>The uploaded file format is not supported.</td></tr><tr><td>401</td><td>Unauthorized</td><td>Invalid or expired API token.</td><td>The API key is invalid or disabled.</td></tr><tr><td>429</td><td>Too many requests</td><td>Too many requests. Please try again later.</td><td>The API rate limit has been exceeded.</td></tr></tbody></table>

***

### Next steps

After uploading evidence for a workflow check, you can:

* Monitor evidence status using workflow check queries
* Upload additional evidence after reviews are completed
* Automate evidence uploads for recurring checks


---

# 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.sprinto.com/api-references/sprinto-cookbooks/add-evidence-for-workflow-check.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.
