# REST API

#### With GitProtect REST API for DevOps ecosystems, you can automate backup and restore tasks, integrating them seamlessly into your development workflows.

***

## Getting the latest backup plan status

{% hint style="warning" %}
The following guide applies to **GitHub**, **Bitbucket** & **GitLab** only.
{% endhint %}

First, use the authorization method to obtain a token, which allows you to perform further operations. After obtaining the token, select the appropriate authentication method as described in the [**API** authentication article](broken://pages/0R1FEf4xmb2esQ8otjQ6).

Once authorized, you can use the `getMany` method to list all your organizations along with their backup plans and most recent statuses.

***

## Activating a license for the repository&#x20;

First, use the authorization method to obtain a token, which allows you to perform further operations. After getting the token, select the appropriate authentication method as described in the [**API** authentication article](broken://pages/0R1FEf4xmb2esQ8otjQ6).

Once authorized, use the `getMany` method to find the repository names and IDs required for the next step. After collecting the repository IDs, use the `Activate` method with an array of the selected repository IDs to activate the license.

***

## Deactivating the license for the repository&#x20;

First, use the authorization method to obtain a token, which allows you to perform further operations. After getting the token, select the appropriate authentication method as described in the [**API** authentication article](broken://pages/0R1FEf4xmb2esQ8otjQ6).

Once authorized, use the `getMany` method to find the repository names and IDs required for the next step. After collecting the repository IDs, use the `Deactivate` method with an array of the selected repository IDs to deactivate the license.

***

## Attach repository to a backup plan&#x20;

First, use the authorization method to obtain a token, which allows you to perform further operations. After getting the token, select the appropriate authentication method as described in the [**API** authentication article](broken://pages/0R1FEf4xmb2esQ8otjQ6).&#x20;

Once authorized, use the `getMany` method (`GitOrganizationController`) to find the backup plan ID and the `getMany` method (`GitRepositoryController`) to obtain the repository ID. After collecting the repository and plan IDs, use the `Attach` method with the selected repository ID and plan ID pair.


---

# 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://helpcenter.gitprotect.io/use-cases/devops/rest-api.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.
