Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function createTask() {
const response = await client.task.create({
title: 'Example chat task title',
type: 'chat', // 'todo' | 'chat' | 'message' | 'ticket'
association: { chat_id: '911234567890' }, // omit when type === 'todo'
status: 'open', // 'open' | 'inprogress' | 'closed'
priority: 1, // 1 | 2 | 3
assignee: 'member1@example.com',
due_date: '2026-06-15T18:00:00.000Z',
remind_at: '2026-06-15T17:30:00.000Z',
notes: 'Example notes for a chat task.',
created_by: 'member1@example.com'
});
console.log(response);
}
createTask();curl -X POST https://api.periskope.app/v1/tasks/create \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"title":"Example todo task title","priority":2}'{
"task_id": "task-elnizmojzrjsogdm",
"title": "Resolve customer escalation",
"type": "message",
"status": "closed",
"priority": 3,
"assignee": "ankit.singh@hashlabs.dev",
"created_by": "anjali.pandey@hashlabs.dev",
"last_updated_by": "ankit.singh@hashlabs.dev",
"created_at": "2026-06-03T06:00:56.592+00:00",
"last_updated_at": "2026-06-04T18:09:36.420636+00:00",
"due_date": "2026-06-15T18:00:00+00:00",
"remind_at": "2026-06-18T18:00:00+00:00",
"notes": "Customer escalated via email — coordinate with support",
"chat_id": "919205202401@c.us",
"association": {
"type": "message",
"message_id": "true_4ca42ab6-77a9-428d-b614-5eb37bcf8f95_anjali.pandey@hashlabs.dev",
"chat_id": "919205202401@c.us"
},
"completed_metadata": {
"completed_at": "2026-06-04T18:09:36.407Z",
"completed_by": "ankit.singh@hashlabs.dev"
}
}Task APIs
Create Task
This endpoint creates a new task
Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function createTask() {
const response = await client.task.create({
title: 'Example chat task title',
type: 'chat', // 'todo' | 'chat' | 'message' | 'ticket'
association: { chat_id: '911234567890' }, // omit when type === 'todo'
status: 'open', // 'open' | 'inprogress' | 'closed'
priority: 1, // 1 | 2 | 3
assignee: 'member1@example.com',
due_date: '2026-06-15T18:00:00.000Z',
remind_at: '2026-06-15T17:30:00.000Z',
notes: 'Example notes for a chat task.',
created_by: 'member1@example.com'
});
console.log(response);
}
createTask();curl -X POST https://api.periskope.app/v1/tasks/create \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"title":"Example todo task title","priority":2}'{
"task_id": "task-elnizmojzrjsogdm",
"title": "Resolve customer escalation",
"type": "message",
"status": "closed",
"priority": 3,
"assignee": "ankit.singh@hashlabs.dev",
"created_by": "anjali.pandey@hashlabs.dev",
"last_updated_by": "ankit.singh@hashlabs.dev",
"created_at": "2026-06-03T06:00:56.592+00:00",
"last_updated_at": "2026-06-04T18:09:36.420636+00:00",
"due_date": "2026-06-15T18:00:00+00:00",
"remind_at": "2026-06-18T18:00:00+00:00",
"notes": "Customer escalated via email — coordinate with support",
"chat_id": "919205202401@c.us",
"association": {
"type": "message",
"message_id": "true_4ca42ab6-77a9-428d-b614-5eb37bcf8f95_anjali.pandey@hashlabs.dev",
"chat_id": "919205202401@c.us"
},
"completed_metadata": {
"completed_at": "2026-06-04T18:09:36.407Z",
"completed_by": "ankit.singh@hashlabs.dev"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
- The title of the task (1–500 characters)
Example:
"Example todo task title"
- The type of the new task
- Possible values:
todo,chat,message,ticket - Default
todo
Available options:
todo, chat, message, ticket Example:
"todo"
- Required when
type !== "todo". Forbidden whentype === "todo". - Must contain exactly one of
chat_id/message_id/ticket_id, matching thetype
Show child attributes
Show child attributes
- Status of the task
- Possible values:
open,inprogress,closed - Default
open
Available options:
open, inprogress, closed Example:
"open"
- The priority of the new task
- Possible values:
1,2,3 - Default
1
Available options:
1, 2, 3 Example:
2
- Email of an org member. Validated against your org's member list
Example:
"ankit.singh@hashlabs.dev"
- The due date of the new task
- Should be in ISO 8601 timestamp format
Example:
"2026-06-15T18:00:00+00:00"
- Free-form text attached to the task
Example:
"Customer escalated via email — coordinate with support"
- The remind date for the task to receive a reminder
- Should be in ISO 8601 timestamp format
Example:
"2026-06-18T18:00:00+00:00"
- Email of an org member. Defaults to
"api"
Example:
"anjali.pandey@hashlabs.dev"
Response
200 - application/json
200 OK
The response is a task object. Refer to the task object here
Was this page helpful?