> 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/api-for-on-demand-remediation.md).

# API for on-demand remediation

To streamline your security workflows, you can schedule on-demand remediation actions to run automatically at a future date on your Google Drive assets.

## Google Drive on-demand remediation actions

Using the DoControl API, you can remediate exposure of sensitive files in your Google Drive inventory with these remediation actions:

* **Remove external collaborators** – Remove sharing permissions from selected assets for all external collaborators who are outside your organization. Internal users and asset owners will still have access.
* **Remove internal collaborators**  – Remove sharing permissions from selected My Drive assets for all internal collaborators who are from your organization. Asset owners and external collaborators will still have access.
* **Remove all collaborators** – Remove both internal and external collaborators from selected My Drive assets, and reset the file to owner-only access.
* **Remove public sharing** - Remove the "Anyone with the link” sharing status to ensure that selected assets cannot be shared publicly.
* **Remove org-wide sharing** - Remove the "Company” sharing status to ensure that selected assets cannot be shared across the organization
* **Change owner** - Transfer assets in a specific user's My Drive to another user's My Drive.
* **Remove permissions** - Remove selected user permissions outside your company domain from all assets. Internal collaborators and asset owners will still have access.
* **Remove specific collaborators** - Remove specific external collaborators from multiple Google Drive assets or a single asset.&#x20;

In DoControl’s API step, Google Drive remediation actions are displayed as follows:

<table><thead><tr><th width="243.56640625" valign="top">Remediation action</th><th valign="top">API</th></tr></thead><tbody><tr><td valign="top">Remove external collaborators</td><td valign="top">GOOGLE_REMOVE_COLLABORATORS</td></tr><tr><td valign="top">Remove internal collaborators</td><td valign="top">GOOGLE_REMOVE_INTERNAL_COLLABORATORS</td></tr><tr><td valign="top">Remove all collaborators</td><td valign="top">GOOGLE_REMOVE_ANY_COLLABORATOR</td></tr><tr><td valign="top">Remove public sharing</td><td valign="top">GOOGLE_REMOVE_PUBLIC_SHARING</td></tr><tr><td valign="top">Remove org-wide sharing</td><td valign="top">GOOGLE_REMOVE_ORG_WIDE_SHARING</td></tr><tr><td valign="top">Change owner</td><td valign="top">GOOGLE_CHANGE_OWNER</td></tr><tr><td valign="top">Remove permissions</td><td valign="top">GOOGLE_REMOVE_COLLABORATOR_FROM_ORG</td></tr><tr><td valign="top">Remove specific collaborators </td><td valign="top">GOOGLE_REMOVE_SPECIFIC_COLLABORATOR_FROM_ASSET</td></tr></tbody></table>

## Filters in APIs

When you leverage the DoControl API step in on-demand remediation, you need to define filters to determine which files get remediated. Filters are expressed as JSON objects and passed to the workflow API call. Here are examples of common filters:

* Shared externally
* Last viewed: More than 180 days ago
* File type = document

{% hint style="success" %}
You can combine multiple filters, for example:

Sharing status + last viewed date + sensitivity
{% endhint %}

## Set up DoControl API step

To set up the DoControl API step for on-demand remediation, follow these steps:&#x20;

1. [Add new mutation](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/utilities/docontrol-api-action/api-for-on-demand-remediation/add-new-mutation.md)
2. [Set up filters for API remediation](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/utilities/docontrol-api-action/api-for-on-demand-remediation/set-up-filters-for-api-remediation.md)
3. [Customize advanced filters](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/utilities/docontrol-api-action/api-for-on-demand-remediation/customize-advanced-filters.md)


---

# 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/api-for-on-demand-remediation.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.
