> For the complete documentation index, see [llms.txt](https://docs.roboteasy.tech/orchestrator/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboteasy.tech/orchestrator/orchestrator/api.md).

# API Integration

How the process should take place step-by-step:

1. Create a user profile;
2. Sign in using the GET Login method, thus retrieving the authentication token;
3. All the following executions should be passed in Header Authorization: Bearer which is the response retrieved at login time;
4. Obtain the Runtime's unique ID by contacting our support;
5. Obtain the unique ID of the robot that will be executed by contacting support;
6. Execute the POST Run or GET Run method with the above data and get the code from the request that will come as a result;
7. Get the response with the GET Result method, passing the Runtime code and the code of the result retrieved earlier.

## Authentication

<mark style="color:green;">`POST`</mark> `https://app.rpaidea.com/api/user/auth`

Logging into the system using auth2 "Bearer authentication".

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Name | Type   | Description                                                                                                           |
| ---- | ------ | --------------------------------------------------------------------------------------------------------------------- |
|      | object | <p>{<br>    "username": "<user@agapys.com>",<br>    "password": "<strong>base64\_encoded\_password</strong>"<br>}</p> |

{% tabs %}
{% tab title="200 Success." %}

```javascript
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJpbnRlZ3JhY2FvX2ZvcmdlQGFnYXB5cy5jb20iLCJpc3MiOiJST0xFX0lOVEVHUkFUSU9OLCIsImV4cCI6MTU3NTgyOTU5Nn0.655IJVQOierSDDe3Yf5tcZo4htpvQPSMAwq4OtdQ4ZycfBF7bP8JssWQe3m7Ad17066SWURArJ7OrjAe-mNyDA
```

{% endtab %}

{% tab title="401 Unauthorized user." %}

```javascript
{
  "timestamp": 1574970103297,
  "status": 401,
  "error": "Unauthorized",
  "message": "Unauthorized",
  "path": "/api/user/auth"
}
```

{% endtab %}
{% endtabs %}

## Authentication V2

<mark style="color:green;">`POST`</mark> `https://app.rpaidea.com/api/user/v2/auth`

Sign in to the system uses the OAuth 2.0 standard.

#### Headers

| Name | Type   | Description      |
| ---- | ------ | ---------------- |
|      | string | application/json |

#### Request Body

| Name | Type   | Description                                                                                                            |
| ---- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
|      | object | <p>{<br>    "username": "<user@agapys.com>",<br>    "password": "<strong>base64\_encoded\_password</strong>",<br>}</p> |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
  "access_token": "jwt_token",
  "token_type": "bearer",
  "expires_in": 2592000
}
```

{% endtab %}

{% tab title="401 Unauthorized user" %}

```javascript
{
  "timestamp": 1574970103297,
  "status": 401,
  "error": "Unauthorized",
  "message": "Unauthorized",
  "path": "/api/user/auth"
}
```

{% endtab %}
{% endtabs %}

## Run robot with parameters

<mark style="color:green;">`POST`</mark> `https://app.rpaidea.com/api/integration/v1/run/{ID_COMPUTER}/{ID_ROBOT}`

Asynchronous execution start of the robot on the indicated Runtime, returning the execution id for future result request.

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer {RESULT-OF-LOGIN} |
| Content-Type  | string | application/json         |

#### Request Body

| Name | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                          |
| ---- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      | object | <p>{<br>    "<strong>variables</strong>": \[ <br>        {<br>            "<strong>name</strong>":"CNPJ",<br>            "<strong>type</strong>": "text",<br>            "<strong>value</strong>":"{VALUE}"<br>        }, <br>        {<br>            "<strong>name</strong>":"IE", <br>            "<strong>type</strong>": "text",<br>            "<strong>value</strong>":"{IE}"<br>        } <br>    ]<br>}</p> |

{% tabs %}
{% tab title="200 Success" %}

```
{ID_EXECUTION}
```

{% endtab %}

{% tab title="401 Unauthorized user." %}

```javascript
{
  "timestamp": 1574970103297,
  "status": 401,
  "error": "Unauthorized",
  "message": "Unauthorized",
  "path": "/api/user/auth"
}S
```

{% endtab %}
{% endtabs %}

## Run robot with parameters v2

<mark style="color:green;">`POST`</mark> `https://app.rpaidea.com/api/integration/v2/run/{ID_COMPUTER}/{ID_ROBOT}`

Asynchronous execution start of the robot on the indicated Runtime, returning the execution id for future result request.

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer {RESULT-OF-LOGIN} |
| Content-Type  | string | application/json         |

#### Request Body

| Name | Type   | Description                                                                                                                       |
| ---- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
|      | object | <p>{<br>    "variables": \[<br>        "name": "CNPJ",<br>        "type": "text",<br>        "value": "{VALUE}"<br>    ]<br>}</p> |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
  "id": "execution_id",
}
```

{% endtab %}
{% endtabs %}

## Run Robot&#x20;

<mark style="color:blue;">`GET`</mark> `https://app.rpaidea.com/api/integration/v1/run/{ID_COMPUTER}/{ID_ROBOT}`

Asynchronous execution start of the robot on the indicated Runtime, returning the execution id for future result request, but without parameters (uses the default parameters).

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer {RESULT-OF-LOGIN} |
| Content-Type  | string | application/json         |

{% tabs %}
{% tab title="200 Success" %}

```
{ID_EXECUTION}
```

{% endtab %}

{% tab title="401 Unauthorized user." %}

```javascript
{
  "timestamp": 1574970103297,
  "status": 401,
  "error": "Unauthorized",
  "message": "Unauthorized",
  "path": "/api/user/auth"
}
```

{% endtab %}
{% endtabs %}

## Run Robot v2

<mark style="color:green;">`POST`</mark> `https://app.rpaidea.com/api/integration/v2/run/{ID_COMPUTER}/{ID_ROBOT}`

Asynchronous execution start of the robot on the indicated Runtime, returning the execution id for future result request, but without parameters (uses the default parameters).

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer {RESULT-OF-LOGIN} |
| Content-Type  | string | application/json         |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
  "id": "execution_id",
}
```

{% endtab %}
{% endtabs %}

## Get execution result

<mark style="color:blue;">`GET`</mark> `https://app.rpaidea.com/api/integration/v1/result/{ID_COMPUTER}/{ID_EXECUTION}`

Busca o resultado de forma parcial ou total da execução do robô - Gets the result of the robot's execution

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer {RESULT-OF-LOGIN} |
| Content-Type  | string | Application/json         |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
  "_id": "7babeddae035ea1a",
  "logs": [],
  "init": 1574975771692,
  "end": null,
  "returnValue": null,
  "status": "PENDENT",
  "progress": 0.0
}
```

{% endtab %}
{% endtabs %}

## Delete task from queue

<mark style="color:red;">`DELETE`</mark> `https://app.rpaidea.com/api/integration/v1/delete/{ID_COMPUTER}/{ID_EXECUTION}`

Deletes tasks that have been added to the queue.

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer {RESULT-OF-LOGIN} |
| Content-Type  | string | Application/json         |

{% tabs %}
{% tab title="200 Success" %}

```
```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

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

```
GET https://docs.roboteasy.tech/orchestrator/orchestrator/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
