Bots API

Get Bots list

To get Bots list using the Bytebot API, you will need to make a Get request to /v2/bots.

Details:

  • Endpoint: /v2/bots
  • Method: GET
  • Headers:
    • x-api-key: <your-api-key>

Example Request:

$GET /v2/bots HTTP/1.1
>Host: api.bytebot.ai
>x-api-key: <your-api-key>
>Content-Type: application/json
>
>
>[
> {
> "id": "your-bot-id1",
> "name": "New Bot",
> "description": null,
> "url": "https://example.com/optional-route",
> "parameters": [
> { "name": "param1", "value": "value1" },
> { "name": "param2", "value": "value2" }
> ]
> },
> {
> "id": "your-bot-id2",
> "name": "New Bot2",
> "description": null,
> "url": "https://example.com/optional-route2",
> "parameters": [
> { "name": "param1", "value": "value1" },
> { "name": "param2", "value": "value2" }
> ]
> }
>]

Get Bot by id

To get Bots list using the Bytebot API, you will need to make a Get request to /v2/bots/<your-bot-id>.

Details:

  • Endpoint: /v2/bots/<your-bot-id>
  • Method: GET
  • Headers:
    • x-api-key: <your-api-key>

Example Request:

$GET /v2/bots/<your-bot-id> HTTP/1.1
>Host: api.bytebot.ai
>x-api-key: <your-api-key>
>Content-Type: application/json
>
>{
> "id": "your-bot-id",
> "name": "New Bot",
> "description": null,
> "url": "https://example.com/optional-route",
> "parameters": [
> { "name": "param1", "value": "value1" },
> { "name": "param2", "value": "value2" }
> ]
>}

Execute a Bot

To execute bots using the Bytebot API, you will need to make a POST request to /v2/bots/execute.

Details:

  • Endpoint: /v2/bots/execute
  • Method: POST
  • Headers:
    • x-api-key: <your-api-key>
  • Body Parameters:
    • botId: The ID of the bot you want to execute (required)
    • url: The URL of the route (optional)
    • parameters: An array of objects with name and value fields for optional input parameters (optional)

Example Request:

$POST /v2/bots/execute HTTP/1.1
>Host: api.bytebot.ai
>Authorization: Bearer <your-api-key>
>Content-Type: application/json
>
>{
> "id": "your-execution-id",
> "botId": "your-bot-id",
> "url": "https://example.com/optional-route", # optional
> "parameters": [
> { "name": "param1", "value": "value1" },
> { "name": "param2", "value": "value2" }
> ]
>}