Skip to main content

Overview

Create a new time entry in your workspace using the Zapier integration API. This endpoint allows you to add time entries with comprehensive information including project associations, task assignments, and tag categorization.
This endpoint is designed for Zapier integrations but can be used with any application that needs to create time entries programmatically.

Authentication

All requests require a valid API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Create Time Entry

curl -X POST 'https://app.timetracker.in/api/integrations/zapier/triggers/time-entries' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "date": "2024-01-15T10:00:00.000Z",
    "description": "Development work on new feature",
    "start_time": "2024-01-15T09:00:00.000Z",
    "end_time": "2024-01-15T17:00:00.000Z",
    "billable": true,
    "manually_entered": true,
    "workspace_id": "w1b2c3d4-e5f6-7890-abcd-ef0987654321",
    "team_member_id": "tm1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "project_id": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "task_id": "t1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "tag_ids": ["tag1a2b3c4-d5e6-7890-abcd-ef1234567890", "tag2b3c4d5-e6f7-8901-bcde-f23456789012"]
  }'

Request Body

workspace_id
string
required
The UUID of the workspace where the time entry will be created.Example: "w1b2c3d4-e5f6-7890-abcd-ef0987654321"
start_time
string
required
The start time of the time entry. Must be a valid ISO 8601 datetime string.Example: "2024-01-15T09:00:00.000Z"
end_time
string
required
The end time of the time entry. Must be a valid ISO 8601 datetime string and after the start time.Example: "2024-01-15T17:00:00.000Z"
billable
boolean
required
Whether this time entry is billable to the client.Example: true
date
string
The date when the time entry occurred. If not provided, defaults to the date from start_time.Example: "2024-01-15T10:00:00.000Z"
description
string
Description of the work performed during this time entry.Example: "Development work on new feature"
duration
number
Duration of the time entry in seconds. If not provided, calculated from start_time and end_time.Example: 28800
manually_entered
boolean
default:"true"
Whether this time entry was entered manually (true) or tracked automatically (false).Example: true
team_member_id
string
The UUID of the team member who performed the work. Must be a valid team member in the workspace.Example: "tm1a2b3c4-d5e6-7890-abcd-ef1234567890"
project_id
string
The UUID of the project associated with this time entry. Must be a valid project in the workspace.Example: "p1a2b3c4-d5e6-7890-abcd-ef1234567890"
task_id
string
The UUID of the task associated with this time entry. Must be a valid task in the specified project.Example: "t1a2b3c4-d5e6-7890-abcd-ef1234567890"
tag_ids
array
Array of tag UUIDs to associate with this time entry. All tags must exist in the workspace.Example: ["tag1a2b3c4-d5e6-7890-abcd-ef1234567890", "tag2b3c4d5-e6f7-8901-bcde-f23456789012"]

Response

Success Response

Returns the created time entry object with all associated data:
{
  "id": "te1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "date": "2024-01-15T10:00:00.000Z",
  "description": "Development work on new feature",
  "start_time": "2024-01-15T09:00:00.000Z",
  "end_time": "2024-01-15T17:00:00.000Z",
  "duration": 28800,
  "duration_hours": 8,
  "billable": true,
  "manually_entered": true,
  "workspace_id": "w1b2c3d4-e5f6-7890-abcd-ef0987654321",
  "workspace_name": "Development Team",
  "team_member_id": "tm1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "team_member_name": "John Doe",
  "team_member_email": "[email protected]",
  "team_member_role": "Developer",
  "project_id": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "project_name": "Mobile App Development",
  "project_status": "active",
  "client_id": "c1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "client_name": "TechCorp Inc.",
  "task_id": "t1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "task_name": "Implement user authentication",
  "task_status": "in-progress",
  "timesheet_id": null,
  "timesheet_status": null,
  "tags": [
    {
      "id": "tag1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "name": "Development",
      "color": "#3B82F6"
    },
    {
      "id": "tag2b3c4d5-e6f7-8901-bcde-f23456789012",
      "name": "Frontend",
      "color": "#10B981"
    }
  ],
  "tag_count": 2,
  "created_at": "2024-01-15T09:00:00.000Z",
  "updated_at": "2024-01-15T17:00:00.000Z"
}

Response Fields

id
string
Unique time entry identifier (UUID format)
date
string
Date when the time entry occurred (ISO 8601 format)
description
string
Description of the work performed
start_time
string
Start time of the time entry (ISO 8601 format)
end_time
string
End time of the time entry (ISO 8601 format)
duration
integer
Duration of the time entry in seconds
duration_hours
number
Duration of the time entry in hours (calculated from seconds)
billable
boolean
Whether the time entry is billable
manually_entered
boolean
Whether the time entry was entered manually
workspace_id
string
Associated workspace identifier
workspace_name
string
Associated workspace name
team_member_id
string
Associated team member identifier
team_member_name
string
Associated team member name
team_member_email
string
Associated team member email
team_member_role
string
Associated team member role
project_id
string
Associated project identifier
project_name
string
Associated project name
project_status
string
Associated project status
client_id
string
Associated client identifier (if project has a client)
client_name
string
Associated client name (if project has a client)
task_id
string
Associated task identifier
task_name
string
Associated task name
task_status
string
Associated task status
timesheet_id
string
Associated timesheet identifier
timesheet_status
string
Associated timesheet status
tags
array
Array of associated tags
tag_count
integer
Total number of tags associated with this time entry
created_at
string
ISO 8601 timestamp when time entry was created
updated_at
string
ISO 8601 timestamp when time entry was last modified

Error Responses

{
  "error": "Invalid request body",
  "details": [
    {
      "field": "start_time",
      "message": "String must contain at least 1 character(s)"
    }
  ]
}
Cause: Required fields are missing or invalid
Solution: Check the request body and ensure all required fields are provided with valid values
{
  "error": "End time must be after start time"
}
Cause: The end_time is before or equal to start_time
Solution: Ensure end_time is after start_time
{
  "error": "Team member does not belong to the specified workspace"
}
Cause: The specified team_member_id doesn’t exist in the workspace
Solution: Verify the team member ID and ensure they belong to the workspace
{
  "error": "Project does not belong to the specified workspace"
}
Cause: The specified project_id doesn’t exist in the workspace
Solution: Verify the project ID and ensure it belongs to the workspace
{
  "error": "Task does not belong to the specified project"
}
Cause: The specified task_id doesn’t exist in the project
Solution: Verify the task ID and ensure it belongs to the specified project
{
  "error": "One or more tags do not belong to the specified workspace"
}
Cause: One or more tag IDs don’t exist in the workspace
Solution: Verify all tag IDs and ensure they belong to the workspace
{
  "error": "Unauthorized"
}
Cause: Invalid or missing API key
Solution: Verify your API key is correct and properly formatted
{
  "error": "Internal server error"
}
Cause: Server-side error during time entry creation
Solution: Retry the request or contact support if the issue persists

Zapier Integration

Zapier Action Configuration

When using this endpoint in Zapier:
  1. Workspace Selection: Use the dynamic dropdown to select the target workspace
  2. Required Fields: workspace_id, start_time, end_time, and billable are required
  3. Team Member Selection: Optionally select a team member from the dynamic dropdown
  4. Project Association: Optionally select a project and task
  5. Tag Assignment: Optionally select tags for categorization

Sample Zapier Usage

1

Trigger Setup

Set up a trigger (e.g., calendar event, form submission) that provides time entry information
2

Action Configuration

Configure the “Create Time Entry” action with:
  • Workspace: Select your target workspace
  • Start Time: Map from trigger data
  • End Time: Map from trigger data
  • Billable: Set billing status
3

Association Setup

Configure associations:
  • Team Member: Select from available team members
  • Project: Select from available projects
  • Task: Select from available tasks (if project selected)
  • Tags: Select relevant tags for categorization
4

Test & Activate

Test the Zap with sample data, then activate for live use

Use Cases

Meeting Time Tracking: Automatically create time entries when calendar events are created, ensuring all meetings and appointments are tracked for billing and reporting.
Task Completion Tracking: Create time entries when tasks are completed in project management tools, maintaining accurate project time records.
Automated Billing: Create billable time entries based on client work activities, ensuring accurate client billing and invoicing.
Activity Tracking: Create time entries for different types of work activities, providing insights into team productivity and time allocation.

Time Entry Best Practices

Time Format Guidelines

  • ISO 8601 Format: Always use ISO 8601 datetime format for consistency
  • Timezone Handling: Include timezone information in datetime strings
  • Duration Calculation: Let the system calculate duration from start/end times when possible

Description Standards

  • Clear Descriptions: Use descriptive text that explains what work was performed
  • Consistent Format: Follow consistent description patterns across your team
  • Context Information: Include relevant context about the work performed

Tagging Strategy

  • Work Type Tags: Use tags to categorize different types of work
  • Project Phase Tags: Tag entries by project phase or milestone
  • Client-Specific Tags: Use tags for client-specific work categorization

Important Notes

Time Validation: End time must be after start time. Invalid time ranges will result in a 400 error.
Duration Calculation: If duration is not provided, it’s automatically calculated from start_time and end_time. The calculation is in seconds.
Best Practices:
  • Always provide clear, descriptive text for time entries
  • Use consistent tagging strategies across your team
  • Validate time ranges before sending requests
  • Associate time entries with appropriate projects and tasks
  • Test with sample data before implementing in production
  • Handle error responses gracefully in your application
  • Consider timezone implications when working with distributed teams

Rate Limits

  • Rate Limit: 100 requests per minute per API key
  • Burst Limit: 10 requests per second
  • Daily Limit: 10,000 requests per day
Rate limits are applied per API key and workspace combination. Contact support if you need higher limits for your use case.