Skip to main content

Overview

Subscribe to webhook events to receive instant notifications when clients are created in your workspace. This endpoint enables Zapier’s “New Client” trigger integration, automatically forwarding client 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": ["CLIENT_CREATED"],
    "description": "Zapier webhook for new clients"
  }'

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:
  • CLIENT_CREATED - Triggered when a new client is added
Example: ["CLIENT_CREATED"]
description
string
Optional description to identify this webhook in your dashboard.Example: "Zapier integration for client notifications"

Response

Success Response

{
  "success": true,
  "webhook": {
    "id": "wh_1234567890abcdef",
    "url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
    "events": ["CLIENT_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 client is created, your webhook endpoint receives a POST request with this payload:
{
  "id": "c1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "name": "Acme Corporation",
  "email": "[email protected]",
  "phone": "+1-800-555-0199",
  "address": "456 Innovation Drive, Silicon Valley, CA 94043",
  "status": "active",
  "type": "company",
  "workspace": {
    "id": "w1b2c3d4-e5f6-7890-abcd-ef0987654321",
    "name": "Acme Main Workspace"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Payload Fields

id
string
Unique client identifier
name
string
Client name or company name
email
string
Primary contact email address
phone
string
Contact phone number
address
string
Full business address
status
string
Client status (active, inactive, etc.)
type
string
Client type (company, individual, etc.)
workspace
object
Associated workspace information
createdAt
string
ISO 8601 timestamp of client 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 Client” trigger
  2. Event Subscription: The integration subscribes to CLIENT_CREATED events
  3. Data Flow: New client 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 client data format used across all client 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