Update a task
client.promptly.tasks.update(stringtaskID, TaskUpdateParams { deliveryEmail, deliveryEmailAddress, deliveryPhoneNumber, 12 more } body, RequestOptionsoptions?): Task { id, createdAt, model, 22 more }
PATCH/api/promptly/tasks/{taskId}
Update an existing task
Parameters
taskID: string
formatuuid
Returns
Update a task
import _0ct from '0ct';
const client = new _0ct({
apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted
});
const task = await client.promptly.tasks.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(task.id);{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"model": "model",
"name": "name",
"prompt": "prompt",
"schedule": "once",
"status": "active",
"cronExpression": "cronExpression",
"deliveryEmail": true,
"deliveryEmailAddress": "dev@stainless.com",
"deliveryPhoneNumber": "deliveryPhoneNumber",
"deliverySms": true,
"destinations": [
{
"type": "email",
"value": "value",
"label": "label"
}
],
"lastRunAt": "2019-12-27T18:11:19.117Z",
"nextRunAt": "2019-12-27T18:11:19.117Z",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"scheduleDays": [
"monday"
],
"scheduleTime": "06:56",
"skillIds": [
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
],
"skills": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"content": "content",
"name": "name",
"category": "category",
"createdAt": "2019-12-27T18:11:19.117Z",
"description": "description",
"frontmatter": {
"author": "author",
"requiredSources": [
"string"
],
"tags": [
"string"
]
},
"iconUrl": "https://example.com",
"isPublic": true,
"isUserInvocable": true,
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"updatedAt": "2019-12-27T18:11:19.117Z",
"version": 0
}
],
"sourceIds": [
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
],
"sources": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"config": {
"args": [
"string"
],
"baseUrl": "https://example.com",
"command": "command",
"env": {
"foo": "string"
},
"transport": "stdio",
"url": "https://example.com"
},
"name": "name",
"type": "mcp",
"authConfig": {
"headerName": "headerName",
"prefix": "prefix",
"provider": "provider"
},
"authType": "none",
"composioConnected": true,
"composioToolkit": "composioToolkit",
"createdAt": "2019-12-27T18:11:19.117Z",
"description": "description",
"iconUrl": "https://example.com",
"isActive": true,
"lastConnectedAt": "2019-12-27T18:11:19.117Z",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"tools": [
{
"description": "description",
"inputSchema": {},
"name": "name"
}
],
"updatedAt": "2019-12-27T18:11:19.117Z"
}
],
"timezone": "timezone",
"updatedAt": "2019-12-27T18:11:19.117Z",
"userId": "userId"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"model": "model",
"name": "name",
"prompt": "prompt",
"schedule": "once",
"status": "active",
"cronExpression": "cronExpression",
"deliveryEmail": true,
"deliveryEmailAddress": "dev@stainless.com",
"deliveryPhoneNumber": "deliveryPhoneNumber",
"deliverySms": true,
"destinations": [
{
"type": "email",
"value": "value",
"label": "label"
}
],
"lastRunAt": "2019-12-27T18:11:19.117Z",
"nextRunAt": "2019-12-27T18:11:19.117Z",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"scheduleDays": [
"monday"
],
"scheduleTime": "06:56",
"skillIds": [
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
],
"skills": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"content": "content",
"name": "name",
"category": "category",
"createdAt": "2019-12-27T18:11:19.117Z",
"description": "description",
"frontmatter": {
"author": "author",
"requiredSources": [
"string"
],
"tags": [
"string"
]
},
"iconUrl": "https://example.com",
"isPublic": true,
"isUserInvocable": true,
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"updatedAt": "2019-12-27T18:11:19.117Z",
"version": 0
}
],
"sourceIds": [
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
],
"sources": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"config": {
"args": [
"string"
],
"baseUrl": "https://example.com",
"command": "command",
"env": {
"foo": "string"
},
"transport": "stdio",
"url": "https://example.com"
},
"name": "name",
"type": "mcp",
"authConfig": {
"headerName": "headerName",
"prefix": "prefix",
"provider": "provider"
},
"authType": "none",
"composioConnected": true,
"composioToolkit": "composioToolkit",
"createdAt": "2019-12-27T18:11:19.117Z",
"description": "description",
"iconUrl": "https://example.com",
"isActive": true,
"lastConnectedAt": "2019-12-27T18:11:19.117Z",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"tools": [
{
"description": "description",
"inputSchema": {},
"name": "name"
}
],
"updatedAt": "2019-12-27T18:11:19.117Z"
}
],
"timezone": "timezone",
"updatedAt": "2019-12-27T18:11:19.117Z",
"userId": "userId"
}