diff --git a/docs/running-tasks/api-v2-spec.mdx b/docs/running-tasks/api-v2-spec.mdx index 0ab196b5..9cfd3f35 100644 --- a/docs/running-tasks/api-v2-spec.mdx +++ b/docs/running-tasks/api-v2-spec.mdx @@ -1,6 +1,6 @@ --- title: Tasks API V2 -description: 'Powerd by the latest version of Skyvern agent, with better reasoning and validation. State of the art web navigation with 85.8% on WebVoyager Eval' +description: 'Powered by the latest version of Skyvern agent, with better reasoning and validation. State of the art web navigation with 85.8% on WebVoyager Eval.' --- ## Request - Initiate a task @@ -19,9 +19,9 @@ Production:`https://api.skyvern.com/api/v2/tasks/` | Parameter | Type | Required? | Sample Value | Description | | --- | --- | --- | --- | --- | -| user_prompt | String | yes | Apply for a job | The prompt that tells the agent what the user-facing goal is. This is the guiding light for the LLM as it navigates a particular website / sitemap to achieve this specified goal | -| url | HttpUrl | no | https://www.example.com | If you want to use a specific url, you can pass it here. It's optional since you can also tell skyvern which site to go to in the user_prompt. | -| webhook_callback_url | HttpUrl | no | … | The callback URL once our system is finished processing this async task | +| user_prompt | String | yes | Find a route between Chicago to Los Angeles on google maps, then print the route details. | +| url | HttpUrl | no | https://www.google.com/maps/ | If you want to use a specific url, you can pass it here. It's optional since you can also tell skyvern which site to go to in the user_prompt. | +| webhook_callback_url | HttpUrl | no | https://mywebsite.com/webhook | The callback URL once our system is finished processing this async task | | proxy_location | String | no | RESIDENTIAL | Proxy location for the web-browsing request. Please pass RESIDENTIAL as a value | | totp_verification_url | HttpUrl | no | https://mywebsite.com/two_factor_code | The url of your TOTP endpoint. If this field is provided, Skyvern will call the url to fetch the TOTP/2FA/MFA code when needed | | totp_identifier | String | no | myemail@example.com / 4155558888 | The email address or the phone number which receives the TOTP/2FA/MFA code. If this field is provided, Skyvern will fetch the code that is pushed to [Skyvern's TOTP API](https://docs.skyvern.com/running-tasks/advanced-features#push-code-to-skyvern) | @@ -32,7 +32,7 @@ Production:`https://api.skyvern.com/api/v2/tasks/` POST https://api.skyvern.com/api/v2/tasks/ { - "user_prompt": "Apply for a job at https://jobs.lever.co/leverdemo-8/45d39614-464a-4b62-a5cd-8683ce4fb80a/apply. Name: Chris P. Bacon, Email: chris@pbacon.com", + "user_prompt": "Find a route between Chicago to Los Angeles on google maps, then print the route details.", "proxy_location": "RESIDENTIAL" } ``` @@ -44,14 +44,14 @@ Each task has an associated `task_id` -- a unique identifier you can use to look | --- | --- | --- | --- | --- | | task_id | String | yes | t_123456 | The task id associated with this specific task | | status | String | yes | created | The status of the task | -| prompt | String | yes | Apply for a job at https://jobs.lever.co/leverdemo-8/45d39614-464a-4b62-a5cd-8683ce4fb80a/apply. Name: Chris P. Bacon, Email: chris@pbacon.com | The user_prompt that skyvern received. | -| url | HttpUrl | yes | https://jobs.lever.co/leverdemo-8/45d39614-464a-4b62-a5cd-8683ce4fb80a/apply | The url that skyvern starts browsing with | +| prompt | String | yes | Find a route between Chicago to Los Angeles on google maps, then print the route details. | +| url | HttpUrl | yes | https://www.google.com/maps/ | The url that skyvern starts browsing with | | organization_id | String | yes | o_123456 | The organization id associated with this task | | workflow_id | String | yes | wf_123456 | The workflow id created by this task | | workflow_run_id | String | yes | wr_123456 | The ID of the workflow run | | workflow_permanent_id | String | yes | wpid_123456 | The workflow permanent id | -| summary | String | no | The summary of what skyvern did when the task is completed | -| output | Object | no | `{ "name": "Chris P. Bacon", "email": "chris@pbacon.com" }` | The output of the task. This is the structured data that skyvern extracted from the website. | +| summary | String | no | The user has successfully found routes between Chicago and Los Angeles on Google Maps. The extracted details include travel modes, travel times, distances, route descriptions, and additional information for each route. | The summary of what skyvern did. | +| output | Object | no | `{ "routes": [{"travel_mode": "Driving", "travel_time": "30 hr", "distance": "2,015 miles", "route_description": "via I-80 W", "additional_info": ["28 hr without traffic", "This route has tolls", "Your destination is in a different time zone"]}] }` | The output of the task. This is the structured data that skyvern extracted from the website. | | webhook_callback_url | HttpUrl | no | https://mywebsite.com/webhook | The url of your webhook endpoint if sent to execute the task. | | totp_verification_url | HttpUrl | no | https://mywebsite.com/two_factor_code | The url of your TOTP endpoint if sent to execute the task. | | totp_identifier | String | no | myemail@example.com / 4155558888 | The totp_identifier sent to execute the task.| @@ -84,10 +84,43 @@ Here's an example of the webhook body: "workflow_run_id": "wr_123456", "workflow_id": "w_123456", "workflow_permanent_id": "wpid_123456", - "prompt": "Apply for a job at https://jobs.lever.co/leverdemo-8/45d39614-464a-4b62-a5cd-8683ce4fb80a/apply. Name: Chris P. Bacon, Email: chris@pbacon.com", - "url": "https://www.coursera.org/", - "summary": "The user successfully applied for a job.", - "output": null, + "prompt": "Find a route between Chicago to Los Angeles on google maps, then print the route details.", + "url": "https://www.google.com/maps/", + "summary": "The user has successfully found routes between Chicago and Los Angeles on Google Maps. The extracted details include travel modes, travel times, distances, route descriptions, and additional information for each route.", + "output": { + "routes": [ + { + "travel_mode": "Driving", + "travel_time": "30 hr", + "distance": "2,015 miles", + "route_description": "via I-80 W", + "additional_info": [ + "28 hr without traffic", + "This route has tolls.", + "Your destination is in a different time zone." + ] + }, + { + "travel_mode": "Driving", + "travel_time": "30 hr", + "distance": "2,028 miles", + "route_description": "via I-80 W and I-70 W", + "additional_info": [ + "28 hr without traffic" + ] + }, + { + "travel_mode": "Flights", + "travel_time": "4 hr 30 min", + "distance": null, + "route_description": "Chicago, IL—Los Angeles, CA", + "additional_info": [ + "from $150" + ] + } + ], + "extraction_datetime": "2025-01-10T22:56:20.297774Z" + }, "totp_verification_url": null, "totp_identifier": null, "proxy_location": null,