Activities
Browse the API reference and sample payloads for Time Magic integrations.
Activities
Activities represent standalone work items.
List activities
Endpoint:
/api/activities
Returns activities for the authenticated user.
Response body
{
"activities": [
{
"id": "<activity_uuid>",
"name": "Writing",
"activity_type": "productive"
}
]
}
Get activity
Endpoint:
/api/activities/:id
Returns an activity by UUID.
Response body
{
"activity": {
"id": "<activity_uuid>",
"name": "Writing",
"activity_type": "productive"
}
}
Create activity
Endpoint:
/api/activities
Create an activity. activity_type can be productive or leisure.
Request body
{
"activity": {
"name": "Writing",
"activity_type": "productive"
}
}
Response body
{
"activity": {
"id": "<activity_uuid>",
"name": "Writing",
"activity_type": "productive"
}
}
Update activity
Endpoint:
/api/activities/:id
Update an activity.
Request body
{
"activity": {
"name": "Deep work",
"activity_type": "productive"
}
}
Response body
{
"activity": {
"id": "<activity_uuid>",
"name": "Deep work",
"activity_type": "productive"
}
}
Start tracking
Endpoint:
/api/activities/:id?event=start_tracking
Start tracking an activity.
Use the
event
query parameter to start tracking.
Response body
{
"activity": {
"id": "<activity_uuid>",
"name": "Deep work",
"activity_type": "productive"
}
}
Stop tracking
Endpoint:
/api/activities/:id?event=stop_tracking
Stop tracking an activity and return it to pending.
Use the
event
query parameter to stop tracking.
Response body
{
"activity": {
"id": "<activity_uuid>",
"name": "Deep work",
"activity_type": "productive"
}
}
Delete activity
Endpoint:
/api/activities/:id
Delete an activity.
Response body
{
"status": "deleted"
}