Create a Task
POST https://api.chartmogul.com/v1/tasks
Creates a task object for a specified ChartMogul user.
curl -X POST "https://api.chartmogul.com/v1/tasks" \ -u YOUR_API_KEY: \ -H "Content-Type: application/json" \ -d '{ "customer_uuid": "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", "task_details": "Schedule product demo", "assignee": "[email protected]", "due_date": "2025-04-21", "completed_at": "2025-04-20" }' ChartMogul::Task.create!( customer_uuid: "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", task_details: "Schedule product demo", assignee: "[email protected]", due_date: "2025-04-21", completed_at: "2025-04-20", ) ChartMogul.Task.create(config, { customer_uuid: "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", task_details: "Schedule product demo", assignee: "[email protected]", due_date: "2025-04-21", completed_at: "2025-04-20", }); ChartMogul\Task::create([ "customer_uuid" => "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", "task_details" => "Schedule product demo", "assignee" => "[email protected]", "due_date" => "2025-04-21", "completed_at" => "2025-04-20" ]); api.CreateTask(&cm.NewTask{ CustomerUUID: "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", TaskDetails: "Schedule product demo", Assignee: "[email protected]", DueDate: "2025-04-21", CompletedAt: "2025-04-20", }) chartmogul.Task.create( config, data={ "customer_uuid": "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", "task_details": "Schedule product demo", "assignee": "[email protected]", "due_date": "2025-04-21", "completed_at": "2025-04-20", }) { "task_uuid": "5d6ec2cc-280d-11f0-b50e-5bd43fc8c28c", "customer_uuid": "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", "task_details": "Schedule product demo", "assignee": "[email protected]", "due_date": "2025-04-21", "completed_at": "2025-04-20", "created_at": "2025-04-20T08:06:31.644Z", "updated_at": "2025-04-20T08:06:31.644Z" } #<ChartMogul::Task:0x00000001058a8210 @task_uuid="5d6ec2cc-280d-11f0-b50e-5bd43fc8c28c", @created_at="2025-04-20T08:06:31.644Z", @updated_at="2025-04-20T08:06:31.644Z", @customer_uuid="cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", @task_details="Schedule product demo", @assignee="[email protected]", @due_date="2025-04-21", @completed_at="2025-04-20" > { task_uuid: "5d6ec2cc-280d-11f0-b50e-5bd43fc8c28c", customer_uuid: "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", task_details: "Schedule product demo", assignee: "[email protected]", due_date: "2025-04-21", completed_at: "2025-04-20", created_at: "2025-04-20T08:06:31.644Z", updated_at: "2025-04-20T08:06:31.644Z" } class ChartMogul\Task (8) { protected $task_uuid => string(36) "5d6ec2cc-280d-11f0-b50e-5bd43fc8c28c" protected $customer_uuid => string(40) "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7" protected $task_details => string(21) "Schedule product demo" protected $assignee => string(20) "[email protected]" protected $due_date => string(10) "2025-04-21" protected $completed_at => string(10) "2025-04-20" protected $created_at => string(24) "2025-04-20T08:06:31.644Z" protected $updated_at => string(24) "2025-04-20T08:06:31.644Z" } (*chartmogul.Task)(0x140004032b0)({ TaskUUID: (string) (len=36) "5d6ec2cc-280d-11f0-b50e-5bd43fc8c28c", CustomerUUID: (string) (len=40) "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", TaskDetails: (string) (len=21) "Schedule product demo", Assignee: (string) (len=20) "[email protected]", DueDate: (string) (len=10) "2025-04-21", CompletedAt: (string) (len=10) "2025-04-20", CreatedAt: (string) (len=24) "2025-04-20T08:06:31.644Z", UpdatedAt: (string) (len=24) "2025-04-20T08:06:31.644Z" }) <Task{ "task_uuid": "5d6ec2cc-280d-11f0-b50e-5bd43fc8c28c", "customer_uuid": "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", "task_details": "Schedule product demo", "assignee": "[email protected]", "due_date": "2025-04-21", "completed_at": "2025-04-20", "created_at": "2025-04-20T08:06:31.644Z", "updated_at": "2025-04-20T08:06:31.644Z" }> Body parameters
customer_uuidstring required- The ChartMogul UUID of the customer associated with the task.
task_detailsstring required- A description of the task up to 255 characters.
assigneestring required- The email address of the ChartMogul user assigned to the task.
due_datestring required- The date when the task is due. Must be an ISO 8601-formatted date.
completed_atstring optional- The date when the task was completed. Must be an ISO 8601-formatted date in the past.
Response
The response object contains the following data:
task_uuid- The ChartMogul UUID of the task.
customer_uuid- The ChartMogul UUID of the customer associated with the task.
task_details- A brief description of the task.
due_date- The date when the task is due as an ISO 8601-formatted string or, in the case of the Ruby and Python libraries, a datetime object.
completed_at- The date when the task was completed as an ISO 8601-formatted string or, in the case of the Ruby and Python libraries, a datetime object. This field returns
nullfor ongoing tasks.