> For the complete documentation index, see [llms.txt](https://docs.docontrol.io/docontrol-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docontrol.io/docontrol-user-guide/workflows/define-workflow-settings/action-settings/utilities/docontrol-api-action.md).

# DoControl API action

Programmatically access DoControl's functionality without interacting with the user interface

The DoControl platform is based on GraphQL APIs. The DoControl API step allows you to programmatically access DoControl's functionality without interacting with the user interface.

Using the DoControl API step allows you to:

* Query exactly the data you need
* Automate repeated or complex workflows
* Trigger inventory actions based on an API

{% hint style="info" %}
Note these limitations when using the DoControl API action step:

* Input and output are limited to a maximum 5MB payload in the action step request.
* In case of no response, there’s a 30 second timeout.
* You can insert only one query or mutation at a time.
* API pagination is not supported.
  {% endhint %}

{% hint style="success" %}
You can also access the DoControl platform externally using [API](/docontrol-user-guide/system-management/api.md) only without workflows.
{% endhint %}

## Use cases for DoControl API

Use cases for leveraging the DoControl API action include:

* [Remediation](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/utilities/docontrol-api-action/api-for-on-demand-remediation.md) - Trigger an inventory action at a scheduled future date, for example, remove specific collaborators from exposed assets every month
* [Offboarding](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/utilities/docontrol-api-action/api-for-offboarding-employees.md) - Trigger an automated remediation action to remove access from all assets shared with the personal emails of terminated employees&#x20;
* Add an external domain to your organization's list of trusted domains
* Update a custom group with new user details
* Add a note to an existing alert after performing a specific action

## Benefits of DoControl API

The DoControl API action is a highly valuable and powerful tool, enabling you to:

* Continuously and automatically enforce access policies across large datasets. This significantly reduces the risk of sensitive files being unintentionally exposed.&#x20;
* Give your team full flexibility to manage, customize, and update workflows programmatically. This allows adjustments without direct interaction with the DoControl user interface.
* Facilitate secure, scalable operations suited for modern compliance and audit requirements.

## How the DoControl API works

When you embed a JSON filter into a workflow’s DoControl API step, you enable DoControl to programmatically identify specific Google Drive assets and automatically apply remediation actions according to predefined criteria.

The API works according to this process:

1. The workflow step embeds a JSON filter string, which directs the automation to query Google Drive and select only those assets that match the specified criteria.&#x20;
2. When the workflow runs, it automatically locates the relevant Google Drive items and applies the selected remediation type without manual intervention.
3. You can adjust the JSON filter at any time, and the workflow can be rescheduled to refine or rerun the process as needed for ongoing automation and control.

## Add a DoControl API action

1. From the **Actions** left pane, select **Utilities > DoControl API**. Drag the action to the canvas, and connect it to the previous action.

2. Click the action to open its settings. <br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FrBIiS4AZEpcLmO5AQn5o%2FDoControl%20API.png?alt=media&amp;token=7908a7c0-edf1-466d-920b-4935470c69c5" alt=""><figcaption><p>With this DoControl API action step, you can automatically add an external domain to your organization's list of trusted domains</p></figcaption></figure>

3. Select the relevant **DoControl API** key from the dropdown to execute the request.&#x20;
   * The API key must have admin permissions.
   * If you don’t have an API key yet, create a new API key via [Settings > API keys](/docontrol-user-guide/system-management/api.md#create-api-keys).

4. Select the request type:
   * **Query** - GET request (get info)
   * **Mutation** -  Post request (perform an action)

5. Insert a custom GraphQL request, or click **API Explorer** to build a request and insert it in the action step.

6. Optional: You can export the response to a JSON file.\
   The API response is displayed in the workflow's execution.

{% hint style="info" %}
For DoControl playbooks that use the **DoControl API** action step, see:

* [Prevent external sharing if user has active alerts](/docontrol-user-guide/risk-management/threat-model-coverage/external-collaborator-sharing/google-drive-playbooks-for-external-sharing.md#prevent-external-sharing-if-user-has-active-alerts)
* [Add external domain to trusted domain list after file share](/docontrol-user-guide/risk-management/threat-model-coverage/it-and-security-operations/google-playbooks-for-it-and-security-operations.md#add-external-domain-to-trusted-domain-list-after-file-share)
* [Prevent terminated employee from sharing with personal email](/docontrol-user-guide/risk-management/threat-model-coverage/personal-account-sharing/google-playbooks-for-personal-account-sharing.md#prevent-terminated-employee-from-sharing-with-personal-email)
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docontrol.io/docontrol-user-guide/workflows/define-workflow-settings/action-settings/utilities/docontrol-api-action.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
