Syncless

个人任务

个人任务 Console API 参考。

创建并启动个人任务

在当前用户的 Personal pipeline 中创建一个个人任务,并立即开始执行。

POST /api/console/v1/personal-tasksAuthorization: Bearer <api_key>Content-Type: application/json

请求体

[  { "type": "text", "text": "Draft a launch checklist." }]

返回

{  "ok": true,  "task": {    "id": "<task_id>",    "title": "Draft a launch checklist."  }}

示例

TypeScript

const BASE_URL = "https://api.syncless.ai"const API_KEY = "<api_key>"const response = await fetch(BASE_URL + "/api/console/v1/personal-tasks", {  method: "POST",  headers: {    "Authorization": "Bearer " + API_KEY,    "Content-Type": "application/json",  },  body: JSON.stringify([    { type: "text", text: "Draft a launch checklist." },  ]),})if (!response.ok) {  throw new Error(await response.text())}console.log(await response.json())

Python

import jsonimport requestsBASE_URL = "https://api.syncless.ai"API_KEY = "<api_key>"body = json.dumps([    {"type": "text", "text": "Draft a launch checklist."},]).encode("utf-8")response = requests.post(    BASE_URL + "/api/console/v1/personal-tasks",    data=body,    headers={        "Authorization": "Bearer " + API_KEY,        "Content-Type": "application/json",    },)response.raise_for_status()print(response.json())

cURL

curl -X POST "https://api.syncless.ai/api/console/v1/personal-tasks" \  -H "Authorization: Bearer <api_key>" \  -H "Content-Type: application/json" \  -d '[    { "type": "text", "text": "Draft a launch checklist." }  ]'

On this page