Skip to main content

Overview

Create a new client in your workspace using the Zapier integration API. This endpoint allows you to add clients with comprehensive information including contact details, billing preferences, and workspace associations.
This endpoint is designed for Zapier integrations but can be used with any application that needs to create clients programmatically.

Authentication

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

Create Client

curl -X POST 'https://app.timetracker.in/api/integrations/zapier/triggers/clients' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "name": "Acme Corporation",
    "type": "company",
    "status": "active",
    "email": "[email protected]",
    "phone": "+1-800-555-0199",
    "address": "456 Innovation Drive, Silicon Valley, CA 94043",
    "note": "Enterprise client with multiple projects",
    "currency": "USD",
    "workspace_id": "w1b2c3d4-e5f6-7890-abcd-ef0987654321"
  }'

Request Body

name
string
required
The name of the client or company. Must be between 1-255 characters.Example: "Acme Corporation"
workspace_id
string
required
The UUID of the workspace where the client will be created.Example: "w1b2c3d4-e5f6-7890-abcd-ef0987654321"
type
string
default:"individual"
The type of client. Valid values:
  • individual - Individual person
  • company - Business or organization
Example: "company"
status
string
default:"active"
The current status of the client. Valid values:
  • active - Client is currently active
  • inactive - Client is temporarily inactive
Example: "active"
email
string
The primary contact email address. Must be a valid email format.Example: "[email protected]"
phone
string
Contact phone number. Can include country code and formatting.Example: "+1-800-555-0199"
address
string
Complete business or mailing address.Example: "456 Innovation Drive, Silicon Valley, CA 94043"
note
string
Additional notes or comments about the client.Example: "Enterprise client with multiple projects"
currency
string
default:"USD"
The default currency for client billing. Should be a valid ISO currency code.Example: "USD"

Response

Success Response

Returns the created client object with all associated data:
{
  "id": "c1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "name": "Acme Corporation",
  "type": "company",
  "status": "active",
  "email": "[email protected]",
  "phone": "+1-800-555-0199",
  "address": "456 Innovation Drive, Silicon Valley, CA 94043",
  "note": "Enterprise client with multiple projects",
  "currency": "USD",
  "workspaces": [
    {
      "id": "w1b2c3d4-e5f6-7890-abcd-ef0987654321",
      "name": "Acme Main Workspace"
    }
  ],
  "projects": [],
  "project_count": 0,
  "workspace_count": 1,
  "created_at": "2024-01-15T10:30:00.000Z",
  "updated_at": "2024-01-15T10:30:00.000Z"
}

Response Fields

id
string
Unique client identifier (UUID format)
name
string
Client or company name
type
string
Client type (individual or company)
status
string
Current client status (active or inactive)
email
string
Primary contact email address
phone
string
Contact phone number
address
string
Complete business address
note
string
Additional notes about the client
currency
string
Default currency for billing
workspaces
array
Array of associated workspaces
projects
array
Array of associated projects
project_count
integer
Total number of projects associated with this client
workspace_count
integer
Total number of workspaces associated with this client
created_at
string
ISO 8601 timestamp when client was created
updated_at
string
ISO 8601 timestamp when client was last modified

Error Responses

{
  "error": "Invalid request body",
  "details": [
    {
      "field": "name",
      "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": "Invalid request body",
  "details": [
    {
      "field": "email",
      "message": "Invalid email"
    }
  ]
}
Cause: Email format is invalid
Solution: Provide a valid email address format
{
  "error": "Unauthorized"
}
Cause: Invalid or missing API key
Solution: Verify your API key is correct and properly formatted
{
  "error": "Workspace not found"
}
Cause: The specified workspace_id doesn’t exist or you don’t have access to it
Solution: Verify the workspace ID and ensure you have proper permissions
{
  "error": "Internal server error"
}
Cause: Server-side error during client 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: Only name and workspace_id are required
  3. Optional Fields: All other fields can be left empty for default values
  4. Data Mapping: Map fields from previous steps in your Zap workflow

Sample Zapier Usage

1

Trigger Setup

Set up a trigger (e.g., new form submission, new email) that provides client information
2

Action Configuration

Configure the “Create Client” action with:
  • Workspace: Select your target workspace
  • Client Name: Map from trigger data
  • Email: Map from trigger data (if available)
  • Phone: Map from trigger data (if available)
3

Optional Fields

Add any additional client information:
  • Type: Set to “company” or “individual”
  • Address: Full business address
  • Notes: Additional context about the client
4

Test & Activate

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

Use Cases

CRM Integration: Automatically create clients when new leads are added to your CRM system, ensuring seamless data flow between platforms.
Website Forms: Create clients automatically when potential customers submit contact forms on your website, reducing manual data entry.
Email Automation: Parse incoming emails and create client records based on email content or sender information.
System Migration: Bulk import clients from other systems during migration or data synchronization processes.

Important Notes

Workspace Association: Clients are automatically associated with the specified workspace. Ensure you’re using the correct workspace ID for your intended organization.
Duplicate Prevention: The system allows multiple clients with the same name. If you need to prevent duplicates, implement validation logic in your integration.
Best Practices:
  • Always validate email format before sending requests
  • Use descriptive notes to provide context about the client
  • Include phone numbers with country codes for international clients
  • Test with sample data before implementing in production
  • Handle error responses gracefully in your application

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.