Skip to main content

Overview

Subscribe to webhook events to receive instant notifications when tasks are created in your workspace. This endpoint enables Zapier’s “New Task” trigger integration, automatically forwarding task data to your connected workflows.
This endpoint is primarily designed for Zapier integrations but can be used with any webhook service that follows the same pattern.

Authentication

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

Subscribe to Events

curl -X POST 'https://app.timetracker.in/api/integrations/zapier/webhooks/subscribe' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
    "events": ["TASK_CREATED"],
    "description": "Zapier webhook for new tasks"
  }'

Request Body

url
string
required
The destination URL for webhook notifications. Must be a valid HTTPS URL format.Example: https://hooks.zapier.com/hooks/catch/123456/abcdef/
events
string[]
required
Array of event types to monitor. Currently supports:
  • TASK_CREATED - Triggered when a new task is added
Example: ["TASK_CREATED"]
description
string
Optional description to identify this webhook in your dashboard.Example: "Zapier integration for task notifications"

Response

Success Response

{
  "success": true,
  "webhook": {
    "id": "wh_1234567890abcdef",
    "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
    "events": ["TASK_CREATED"],
    "status": "ACTIVE"
  }
}
success
boolean
Confirms successful webhook creation.
webhook
object
The created webhook subscription details.

Error Responses

{
  "error": "Invalid URL format"
}
The provided URL doesn’t meet the required format standards.
{
  "error": "URL and events array are required"
}
Required parameters url or events are missing from the request.
{
  "error": "Unauthorized"
}
Invalid or missing API key in the Authorization header.
{
  "error": "Internal server error"
}
An unexpected server error occurred. Try again or contact support.

Webhook Payload Structure

When a task is created, your webhook endpoint receives a POST request with this payload:
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Implement user authentication",
  "description": "Add user authentication system to the mobile app",
  "project": {
    "id": "456e7890-e89b-12d3-a456-426614174001",
    "name": "Mobile App Development"
  },
  "client": {
    "id": "789e0123-e89b-12d3-a456-426614174002",
    "name": "Acme Corporation",
    "email": "[email protected]",
    "phone": "+1-555-0123",
    "status": "active",
    "type": "enterprise"
  },
  "workspace": {
    "id": "abc12345-e89b-12d3-a456-426614174003",
    "name": "Development Team"
  },
  "teamMembers": [
    {
      "id": "def67890-e89b-12d3-a456-426614174004",
      "name": "John Doe",
      "email": "[email protected]",
      "avatar": "https://example.com/avatar.jpg",
      "designation": "Senior Developer",
      "department": "Engineering",
      "status": "active",
      "role": {
        "id": "ghi11111-e89b-12d3-a456-426614174005",
        "name": "Developer",
        "description": "Software development role"
      },
      "billableRate": 75.0,
      "currency": "USD"
    }
  ],
  "status": "todo",
  "priority": "high",
  "estimatedHours": 16.0,
  "dueDate": "2024-01-25T23:59:59.000Z",
  "createdAt": "2024-01-15T10:00:00.000Z",
  "updatedAt": "2024-01-15T10:00:00.000Z"
}

Payload Fields

id
string
Unique task identifier
name
string
Task name
description
string
Task description
project
object
Associated project information
client
object
Associated client information
workspace
object
Associated workspace information
teamMembers
array
Array of team members assigned to the task
status
string
Task status (todo, in_progress, completed, cancelled, etc.)
priority
string
Task priority (low, medium, high, urgent)
estimatedHours
number
Estimated hours to complete the task
dueDate
string
Task due date in ISO 8601 format
createdAt
string
ISO 8601 timestamp of task creation
updatedAt
string
ISO 8601 timestamp of last update

Zapier Integration Guide

Setting Up the Trigger

  1. Automatic Setup: Zapier automatically calls this endpoint when you configure a “New Task” trigger
  2. Event Subscription: The integration subscribes to TASK_CREATED events
  3. Data Flow: New task data is instantly sent to your Zap workflow
Zapier automatically provides the webhook URL via bundle.targetUrl when setting up the trigger. You don’t need to manually generate URLs.

Important Notes

Workspace Scope: Webhook subscriptions are tied to your specific API key and workspace. Ensure you’re using the correct credentials for your intended workspace.
Data Format: The webhook payload structure matches the standard task data format used across all task API endpoints, ensuring consistency in your integrations.
Best Practices:
  • Validate webhook signatures if implementing custom security
  • Implement proper error handling for webhook delivery failures
  • Use HTTPS endpoints only for security
  • Test your webhook endpoint before subscribing