> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timetracker.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Task Fallback Data

> Retrieve sample task data for testing Zapier triggers and previewing data structures.

## Overview

The fallback endpoint provides sample task data for Zapier trigger testing and configuration. When setting up a "New Task" trigger, Zapier uses this endpoint to show users the expected data structure, making it easier to configure workflows before activating live webhook subscriptions.

<Note>
  This endpoint intelligently returns your most recent task data when available, or consistent sample data for testing when your workspace has no tasks yet.
</Note>

## Authentication

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

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Get Sample Data

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://app.timetracker.in/api/integrations/zapier/triggers/tasks/fallback' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.timetracker.in/api/integrations/zapier/triggers/tasks/fallback', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(data[0]); // First (and typically only) task object
  ```

  ```python Python theme={null}
  import requests

  url = "https://app.timetracker.in/api/integrations/zapier/triggers/tasks/fallback"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  task_data = response.json()[0]  # First task object
  ```
</CodeGroup>

## Response

### Success Response

Returns an array containing one task object - either your most recent task or sample data:

```json theme={null}
[
  {
    "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": "contact@acme.com",
      "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": "john@example.com",
        "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"
  }
]
```

### Data Fields

<ResponseField name="id" type="string">
  Unique task identifier (UUID format)
</ResponseField>

<ResponseField name="name" type="string">
  Task name
</ResponseField>

<ResponseField name="description" type="string">
  Task description
</ResponseField>

<ResponseField name="project" type="object">
  Associated project information

  <Expandable title="Project Object">
    <ResponseField name="id" type="string">
      Unique project identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Project name
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="client" type="object">
  Associated client information

  <Expandable title="Client Object">
    <ResponseField name="id" type="string">
      Unique client identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Client name
    </ResponseField>

    <ResponseField name="email" type="string">
      Client email address
    </ResponseField>

    <ResponseField name="phone" type="string">
      Client phone number
    </ResponseField>

    <ResponseField name="status" type="string">
      Client status
    </ResponseField>

    <ResponseField name="type" type="string">
      Client type (enterprise, company, individual, etc.)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="workspace" type="object">
  Associated workspace information

  <Expandable title="Workspace Object">
    <ResponseField name="id" type="string">
      Unique workspace identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Human-readable workspace name
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="teamMembers" type="array">
  Array of team members assigned to the task

  <Expandable title="Team Member Array">
    <ResponseField name="id" type="string">
      Team member unique identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Team member name
    </ResponseField>

    <ResponseField name="email" type="string">
      Team member email address
    </ResponseField>

    <ResponseField name="avatar" type="string">
      URL to team member avatar image
    </ResponseField>

    <ResponseField name="designation" type="string">
      Team member job title
    </ResponseField>

    <ResponseField name="department" type="string">
      Team member department
    </ResponseField>

    <ResponseField name="status" type="string">
      Team member status
    </ResponseField>

    <ResponseField name="role" type="object">
      Team member role information

      <Expandable title="Role Object">
        <ResponseField name="id" type="string">
          Role unique identifier
        </ResponseField>

        <ResponseField name="name" type="string">
          Role name
        </ResponseField>

        <ResponseField name="description" type="string">
          Role description
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="billableRate" type="number">
      Team member hourly billable rate
    </ResponseField>

    <ResponseField name="currency" type="string">
      Currency for billable rate
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="status" type="string">
  Current task status

  * `todo` - Task is pending
  * `in_progress` - Task is currently being worked on
  * `completed` - Task has been completed
  * `cancelled` - Task has been cancelled
</ResponseField>

<ResponseField name="priority" type="string">
  Task priority level

  * `low` - Low priority
  * `medium` - Medium priority
  * `high` - High priority
  * `urgent` - Urgent priority
</ResponseField>

<ResponseField name="estimatedHours" type="number">
  Estimated hours to complete the task
</ResponseField>

<ResponseField name="dueDate" type="string">
  Task due date in ISO 8601 format
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp when task was created
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp when task was last modified
</ResponseField>

### Error Responses

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    ```json theme={null}
    {
      "error": "Unauthorized"
    }
    ```

    **Cause**: Invalid or missing API key\
    **Solution**: Verify your API key is correct and properly formatted
  </Accordion>

  <Accordion title="500 Internal Server Error">
    ```json theme={null}
    {
      "error": "Failed to fetch tasks"
    }
    ```

    **Cause**: Server-side error during data retrieval\
    **Solution**: Retry the request or contact support if the issue persists
  </Accordion>
</AccordionGroup>

### Sample Data Format

When your workspace has no tasks, you'll receive this consistent sample data:

```json theme={null}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Sample Task Implementation",
  "description": "Add sample functionality to the application",
  "project": {
    "id": "456e7890-e89b-12d3-a456-426614174001",
    "name": "Sample Project"
  },
  "client": {
    "id": "789e0123-e89b-12d3-a456-426614174002",
    "name": "Sample Client",
    "email": "contact@sample.com",
    "phone": "+1-555-0123",
    "status": "active",
    "type": "company"
  },
  "workspace": {
    "id": "abc12345-e89b-12d3-a456-426614174003",
    "name": "Sample Workspace"
  },
  "teamMembers": [
    {
      "id": "def67890-e89b-12d3-a456-426614174004",
      "name": "Sample Developer",
      "email": "developer@sample.com",
      "avatar": "https://example.com/avatar.jpg",
      "designation": "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": "medium",
  "estimatedHours": 8.0,
  "dueDate": "2024-01-25T23:59:59.000Z",
  "createdAt": "2024-01-15T10:00:00.000Z",
  "updatedAt": "2024-01-15T10:00:00.000Z"
}
```

## Zapier Integration Workflow

### How Zapier Uses This Endpoint

<Steps>
  <Step title="Trigger Configuration">
    When you set up a "New Task" trigger in Zapier, it automatically calls this endpoint to fetch sample data.
  </Step>

  <Step title="Data Structure Display">
    Zapier shows you the returned task data structure, including all available fields and their formats.
  </Step>

  <Step title="Field Mapping Setup">
    You can map specific task fields (like `name`, `description`, `project.name`, `client.name`) to actions in your workflow.
  </Step>

  <Step title="Testing & Validation">
    Use the sample data to test your workflow logic before activating live webhook notifications.
  </Step>

  <Step title="Production Activation">
    Once configured, Zapier switches to receiving real-time data via webhook subscriptions.
  </Step>
</Steps>

<Tip>
  **Pro Tip**: The data structure shown during setup matches exactly what you'll receive in live webhook payloads, so you can confidently design your workflows around the sample data.
</Tip>

## Use Cases

<AccordionGroup>
  <Accordion title="Zapier Trigger Setup">
    **Primary Use**: Zapier automatically calls this endpoint when users configure "New Task" triggers to show them what data will be available.
  </Accordion>

  <Accordion title="Integration Development">
    **Development Use**: Test your integration logic with consistent, predictable data structures before connecting to live task creation events.
  </Accordion>

  <Accordion title="Documentation & Training">
    **Reference Use**: Use the returned data structure to document what fields are available in your task management workflows.
  </Accordion>

  <Accordion title="Workflow Validation">
    **Testing Use**: Validate that your automation workflows can handle all the task data fields before going live.
  </Accordion>
</AccordionGroup>

## Important Notes

<Warning>
  **Data Consistency Guarantee**: The structure returned by this endpoint exactly matches the webhook payload format, ensuring seamless transition from testing to production.
</Warning>

<Info>
  **Workspace Isolation**: Only returns real task data from your authenticated workspace. Cross-workspace data access is prevented for security.
</Info>

<Check>
  **Integration Best Practices**:

  * Always test your workflows with this sample data first
  * The endpoint returns an array, so access the first element: `data[0]`
  * All dates use ISO 8601 format for consistent parsing
  * Task IDs are always UUIDs for reliable identification
  * Team member arrays may be empty for tasks with no assigned members
  * Priority and status fields use predefined values
  * Estimated hours use decimal numbers for precision
</Check>

## Testing Your Integration

To test how your application handles task data:

1. **Call the endpoint** with your API credentials
2. **Parse the response** and extract the first task object
3. **Validate data types** match your expected formats
4. **Test field mapping** for your specific use case
5. **Handle edge cases** like missing optional fields or empty arrays

This ensures your integration works smoothly when real task data starts flowing through webhooks.
