TimeTac Webhooks
Effortlessly integrate with TimeTac and streamline your workflow!
What Are Webhooks?
Webhooks are automatic messages sent to your system when certain events happen in TimeTac. They allow you to receive real-time updates and easily connect TimeTac with your own applications.
How to Set Up Webhooks in TimeTac
-
1. Choose What to Track:
Decide which actions or data you want to monitor, such as
timetrackings/start
. You can create webhooks for any Create, Update, or Delete API action listed in our API documentation. - 2. Contact Support: Email us at support@timetac.com to request setup of your WebhookEndpoints. Only our team can configure these due to strict security settings on outgoing traffic.
-
3. Create Your Webhook:
Once your WebhookEndpoint is set up, use the
webhooks/create
API endpoint with these parameters:- Name: e.g., "Start Timer Webhook"
- URL: Your receiving endpoint, e.g.,
https://mydomain.com/hook
- Webhook Endpoint ID: The ID from your configured WebhookEndpoint
- Active: Use
1
to enable the webhook - Secret: A unique Bearer token that will be sent in the Authorization header
Webhook Payload and Headers
When your webhook is triggered, we send a POST request to your URL with a payload. The payload contains the same data you'd get from a normal API response (e.g., time tracking data).
Extra information is also sent in the request headers:
X-Account
: Account login nameX-Code-Version
: Version of the account's codebaseX-Entity-Type
: The type of entity (e.g.,timetrackings
)X-Entity-Action
: The action performed (e.g.,start
)X-Event-Timestamp
: When the event occurred
Retry and Error Handling
If your server cannot be reached, TimeTac will try to send the webhook once more. If it fails again, the webhook will be automatically disabled and a notification will be sent to your technical contact.
Example
- A WebhookEndpoint is created for
timetrackings/start
. - A webhook is created with:
- Name:
Send hook on start of a timer
- URL:
https://webhook.site/ad1955f3-8ec4-4737-8e22-3b59205f3f43
- Active:
1
- Name:
- The
timetrackings/start
API endpoint is called. - TimeTac sends the following payload to your webhook URL:
{ "Results": [ { "id": 1, "user_id": 1, "task_id": 4, "start_time": "2024-12-02 15:22:04", "duration": 0, "status": 1, "is_billable": true, "start_ip": "127.0.0.1", "created_at": "2024-12-02 15:22:05", "start_timezone": "Europe/Berlin", ... } ] }