Skip to main content

Robot API

1. Request: Get All Robots

  • Request type: GET
  • Route: /api/robots
  • Description: Retrieve a list of all robots.

Parameters

No parameters

Responses

CodeDescriptionMedia Type
200A list of robots.application/json

Example Value Schema

{
"statusCode": 200,
"messageCode": "success",
"robots": {
"totalCount": 2,
"items": [
{
"id": "0a3acb0f-4928-483b-8610-35049efa90fd",
"name": "100 Blog Posts",
"createdAt": 1748765979000,
"inputParameters": [
{
"type": "string",
"name": "originUrl",
"label": "Origin URL",
"required": true,
"defaultValue": "https://linktr.ee/blog/trends/"
}
]
},
{
"id": "9d458b00-e9dd-4799-b5f2-0166565d2af3",
"name": "HackerNews",
"createdAt": 1748765979219,
"inputParameters": [
{
"type": "string",
"name": "originUrl",
"label": "Origin URL",
"required": true,
"defaultValue": "https://news.ycombinator.com/"
}
]
}
]
}
}

| 500 | Error retrieving robots. | application/json |

Example Value Schema

{
"statusCode": 500,
"messageCode": "error",
"message": "Failed to retrieve robots"
}

2. Request: Get Robot By ID

  • Request type: GET
  • Route: GET /api/robots/{id}
  • Description: Retrieve a robot by its ID.

Parameters

NameDescription
id (required) stringThe ID of the robot to retrieve.

Responses

CodeDescriptionMedia Type
200Robot details.application/json

Example Value Schema

{
"statusCode": 200,
"messageCode": "success",
"robot": {
"id": "0a3acb0f-4928-483b-8610-35049efa90fd",
"name": "10 post link tree",
"createdAt": 1748765979000,
"inputParameters": [
{
"type": "string",
"name": "originUrl",
"label": "Origin URL",
"required": true,
"defaultValue": "https://linktr.ee/blog/trends/"
}
]
}
}
CodeDescriptionMedia Type
404Robot not found.application/json

Example Value Schema

{
"statusCode": 404,
"messageCode": "not_found",
"message": "Recording with ID not found."
}

3. Request: Duplicate a Robot

  • Request type: POST
  • Route: /api/robots/{id}/duplicate
  • Description: Duplicate an existing robot to run it on a different URL with the same structure.

Parameters

NameDescription
id (required) stringThe ID of the robot to duplicate.

Request Body

NameDescription
targetUrl (required) stringThe new URL to target in the duplicated robot.

Responses

CodeDescriptionMedia Type
201Robot duplicated successfully.application/json

Example Value Schema

{
"statusCode": 201,
"messageCode": "success",
"robot": {
"id": "e4b3c2d1-0a9b-8c7d-6e5f-4g3h2i1j0k9l",
"name": "HackerNews (show)",
"createdAt": 1748765980000,
"inputParameters": [
{
"type": "string",
"name": "originUrl",
"label": "Origin URL",
"required": true,
"defaultValue": "https://news.ycombinator.com/show"
}
]
}
}
CodeDescriptionMedia Type
404Robot not found.application/json

Example Value Schema

{
"statusCode": 404,
"messageCode": "not_found",
"message": "Robot with ID not found."
}
CodeDescriptionMedia Type
500Internal server error.application/json

4. Request: Schedule Recurring Runs For A Robot

  • Request type: POST
  • Route: /api/robots/{id}/schedule
  • Description: Create or replace a recurring schedule for a robot. The robot will run automatically based on the provided frequency. Re-posting to this endpoint replaces any existing schedule.

Parameters

NameDescription
id (required) stringThe ID of the robot to schedule.

Request Body

NameDescription
runEvery (required) integerHow often the robot runs, in units of runEveryUnit.
runEveryUnit (required) stringThe schedule unit. Accepted values: MINUTES, HOURS, DAYS, WEEKS, MONTHS.
startFrom (required) stringThe day to start from. Accepted values: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY.
atTimeStart (required) stringStart time in HH:MM 24-hour format.
atTimeEnd (required) stringEnd time in HH:MM 24-hour format.
timezone (required) stringIANA timezone name, such as UTC or Asia/Kolkata.
dayOfMonth stringDay of the month. Used only when runEveryUnit is MONTHS.

Example Request Body

{
"runEvery": 6,
"runEveryUnit": "HOURS",
"startFrom": "MONDAY",
"atTimeStart": "09:00",
"atTimeEnd": "17:00",
"timezone": "UTC"
}

Responses

CodeDescriptionMedia Type
200Schedule created successfully.application/json

Example Value Schema

{
"statusCode": 200,
"messageCode": "success",
"schedule": {
"runEvery": 6,
"runEveryUnit": "HOURS",
"startFrom": "MONDAY",
"atTimeStart": "09:00",
"atTimeEnd": "17:00",
"timezone": "UTC",
"cronExpression": "0 9-17/6 * * *",
"nextRunAt": "2025-06-02T09:00:00.000Z"
}
}
CodeDescriptionMedia Type
400Invalid schedule parameters.application/json

Example Value Schema

{
"statusCode": 400,
"messageCode": "bad_request",
"message": "Invalid schedule parameters.",
"field": "runEveryUnit"
}
CodeDescriptionMedia Type
401Unauthorized access.application/json

Example Value Schema

{
"statusCode": 401,
"messageCode": "error",
"message": "Unauthorized"
}
CodeDescriptionMedia Type
404Robot not found.application/json

Example Value Schema

{
"statusCode": 404,
"messageCode": "not_found",
"message": "Robot with ID not found."
}
CodeDescriptionMedia Type
500Error scheduling robot.application/json

Example Value Schema

{
"statusCode": 500,
"messageCode": "error",
"message": "Failed to schedule robot"
}

5. Request: Get A Robot's Schedule

  • Request type: GET
  • Route: /api/robots/{id}/schedule
  • Description: Retrieve the current recurring schedule for a robot, or null if no schedule is set.

Parameters

NameDescription
id (required) stringThe ID of the robot.

Responses

CodeDescriptionMedia Type
200The robot's schedule.application/json

Example Value Schema

{
"statusCode": 200,
"messageCode": "success",
"schedule": {
"runEvery": 6,
"runEveryUnit": "HOURS",
"startFrom": "MONDAY",
"atTimeStart": "09:00",
"atTimeEnd": "17:00",
"timezone": "UTC",
"cronExpression": "0 9-17/6 * * *",
"nextRunAt": "2025-06-02T09:00:00.000Z"
}
}
CodeDescriptionMedia Type
401Unauthorized access.application/json

Example Value Schema

{
"statusCode": 401,
"messageCode": "error",
"message": "Unauthorized"
}
CodeDescriptionMedia Type
404Robot not found.application/json

Example Value Schema

{
"statusCode": 404,
"messageCode": "not_found",
"message": "Robot with ID not found."
}
CodeDescriptionMedia Type
500Error retrieving schedule.application/json

Example Value Schema

{
"statusCode": 500,
"messageCode": "error",
"message": "Failed to retrieve schedule"
}

6. Request: Delete A Robot's Schedule

  • Request type: DELETE
  • Route: /api/robots/{id}/schedule
  • Description: Cancel a robot's recurring schedule. This endpoint succeeds even if the robot has no schedule.

Parameters

NameDescription
id (required) stringThe ID of the robot.

Responses

CodeDescriptionMedia Type
200Schedule deleted successfully.application/json

Example Value Schema

{
"statusCode": 200,
"messageCode": "success",
"message": "Schedule deleted successfully"
}
CodeDescriptionMedia Type
401Unauthorized access.application/json

Example Value Schema

{
"statusCode": 401,
"messageCode": "error",
"message": "Unauthorized"
}
CodeDescriptionMedia Type
404Robot not found.application/json

Example Value Schema

{
"statusCode": 404,
"messageCode": "not_found",
"message": "Robot with ID not found."
}
CodeDescriptionMedia Type
500Error deleting schedule.application/json

Example Value Schema

{
"statusCode": 500,
"messageCode": "error",
"message": "Failed to delete schedule"
}