TeamTrace API Request Examples

Created by TeamTrace Support, Modified on Mon, 16 Nov at 4:58 AM by TeamTrace Support

Overview

This article collects ready-to-use request examples for the TeamTrace API. For each endpoint you will find the URL, the headers and parameters it needs, a cURL example you can copy, and what to expect back. Use it as a quick reference when you build or test your integration.


Before You Begin

  • You need a valid authorization token for every endpoint except the authorization endpoint itself. See How to Authenticate with the TeamTrace API.
  • Replace placeholders such as YOUR_TOKEN, YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with your own values. The IDs and dates in the examples are samples.
  • All endpoints are on https://api-info.teamtrace.app.
  • Make sure you can send HTTPS requests, for example with cURL, Postman or code in your own application.


Endpoints at a Glance

APIMethodPathWhat it returns
API AuthorizationPOST/api/authorizationAn authorization token for your application.
Customer ListGET/api/v1/fetch-customer-listA list of customers.
Customer Task ListPOST/api/v1/fetch-customer-task-listThe tasks of one customer.
User ListGET/api/v1/user/listA list of users.
Leave ListPOST/api/v1/company-leave/listEmployee leave records.
Employee Screenshot FetchPOST/api/v1/screenshot-fetchAn employee's screenshots for a date.
Detailed TimesheetPOST/api/v1/worklog-summary/detailed-timesheet-reportDetailed timesheet entries for a date.
Field People TimesheetPOST/api/v1/worklog-summary/field-people-timesheetTimesheets and visits of field employees.


Headers Used in Every Request

HeaderUsed forValue
x-client-idThe authorization request only.Your Client ID.
x-client-secretThe authorization request only.Your Client Secret.
authorizationEvery other request.Your authorization token.
Content-TypeRequests that send a JSON body.application/json


Example 1: Get an Authorization Token

Send your Client ID and Client Secret in the headers. No request body is needed.

curl -X POST "https://api-info.teamtrace.app/api/authorization" \
 -H "x-client-id: YOUR_CLIENT_ID" \
 -H "x-client-secret: YOUR_CLIENT_SECRET"

If the credentials are valid, the API returns a successful response, which typically includes an authorization token or confirmation. Use the token in the authorization header of the requests below.


Example 2: Fetch the Customer List

A GET request. The filters go in the URL.

ParameterRequiredDescription
customer_statusYesACTIVE (current customers) or INACTIVE (past customers).
nameNoSearch by customer name.
company_nameNoSearch by company name.
limitNoResults per page. A whole number of 1 or more.
pageNoPage number. A whole number of 1 or more.

This request returns the first 10 current customers whose company name matches "Tech".

curl --request GET "https://api-info.teamtrace.app/api/v1/fetch-customer-list?customer_status=ACTIVE&company_name=Tech&page=1&limit=10" \
 --header "authorization: YOUR_TOKEN"

Example 3: Fetch the Customer Task List

A POST request. Pagination goes in the URL, and the filters go in a JSON body.

WhereFieldRequiredDescription
BodyuuidYesThe customer's UUID. It must be a valid UUID.
Bodytask_nameNoFilter by task name.
Bodycreated_start_dateNoTasks created on or after this date (YYYY-MM-DD).
Bodycreated_end_dateNoTasks created on or before this date (YYYY-MM-DD).
URLlimit, pageNoPagination. Whole numbers of 1 or more.
curl --request POST "https://api-info.teamtrace.app/api/v1/fetch-customer-task-list?page=1&limit=10" \
 --header "authorization: YOUR_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
 "uuid": "550e8400-e29b-41d4-a716-446655440000",
 "task_name": "Development",
 "created_start_date": "2026-04-01",
 "created_end_date": "2026-04-30"
 }'


Example 4: Fetch the User List

A GET request. All parameters are optional. With no filters, the API returns all users.

ParameterDescription
user_current_statusP for past users, C for current users, or empty for all users.
limitRecords per page. A whole number of 1 or more.
pagePage number. A whole number of 1 or more.

This request returns the first 10 current users.

curl --request GET "https://api-info.teamtrace.app/api/v1/user/list?user_current_status=C&limit=10&page=1" \
 --header "authorization: YOUR_TOKEN"


Example 5: Fetch the Leave List

A POST request. Pagination goes in the URL, and the optional filters go in a JSON body.

FieldRequiredDescription
uuidNoThe employee ID.
apply_dateNoThe date the leave was applied for (YYYY-MM-DD).
from_dateNoThe leave start date (YYYY-MM-DD).
to_dateNoThe leave end date (YYYY-MM-DD).
statusNoThe leave status. See the values below.
Status valueMeaning
PPending
CCompleted
RRejected
CNCancelled
Empty or nullAll statuses
curl -X POST "https://api-info.teamtrace.app/api/v1/company-leave/list?limit=10&page=1" \
 -H "authorization: YOUR_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
 "uuid": "EMP123",
 "apply_date": "2026-04-01",
 "from_date": "2026-04-10",
 "to_date": "2026-04-12",
 "status": "P"
 }'


Example 6: Fetch an Employee's Screenshots

A POST request with a JSON body. Both fields are required.

FieldRequiredDescription
dateYesThe date, in YYYY-MM-DD format.
user_idYesThe employee's ID. It must be a valid UUID.
curl --request POST \
 --url https://api-info.teamtrace.app/api/v1/screenshot-fetch \
 --header 'Content-Type: application/json' \
 --header 'authorization: YOUR_AUTH_TOKEN' \
 --data '{
 "date": "2026-04-21",
 "user_id": "123e4567-e89b-12d3-a456-426614174000"
 }'

If there are no screenshots for that date, the list in the response is empty. This is not an error.


Example 7: Fetch the Detailed Timesheet

A POST request. page and limit are required in the URL, and the filters go in a JSON body.

WhereFieldRequiredDescription
URLpageYesPage number. A whole number of 1 or more.
URLlimitYesItems per page. A whole number of 1 or more.
BodydateYesThe date, in YYYY-MM-DD format.
Bodyuser_idNoFilter by one user. It must be a valid UUID.
curl --request POST \
 --url 'https://api-info.teamtrace.app/api/v1/worklog-summary/detailed-timesheet-report?page=1&limit=10' \
 --header 'Content-Type: application/json' \
 --header 'authorization: YOUR_AUTH_TOKEN' \
 --data '{
 "date": "2026-04-21",
 "user_id": "123e4567-e89b-12d3-a456-426614174000"
 }'

Example success response

{
  "status": "success",
  "page": 1,
  "limit": 10,
  "total": 45,
  "data": [
    {
      "user_id": "123e4567-e89b-12d3-a456-426614174000",
      "date": "2026-04-21",
      "total_hours": "07:30",
      "entries": [
        {
          "start_time": "09:00",
          "end_time": "11:30",
          "duration": "02:30",
          "activity": "Development"
        }
      ]
    }
  ]
}

If there are no records, the response has "total": 0 and an empty data list. This is not an error.


Example 8: Fetch the Field People Timesheet

This request works like the Detailed Timesheet request. page and limit are required in the URL, and date is required in the body. The optional user_id filters by one field employee.

curl --request POST \
 --url 'https://api-info.teamtrace.app/api/v1/worklog-summary/field-people-timesheet?page=1&limit=10' \
 --header 'Content-Type: application/json' \
 --header 'authorization: YOUR_AUTH_TOKEN' \
 --data '{
 "date": "2026-04-21",
 "user_id": "123e4567-e89b-12d3-a456-426614174000"
 }'

Example success response

{
  "status": "success",
  "page": 1,
  "limit": 10,
  "total": 20,
  "data": [
    {
      "user_id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Field Employee 1",
      "date": "2026-04-21",
      "total_hours": "06:45",
      "visits": [
        {
          "location": "Client Site A",
          "check_in": "09:00",
          "check_out": "11:15",
          "duration": "02:15"
        }
      ]
    }
  ]
}


Common Error Responses

When a request fails, the API returns an error in this shape:

{
  "status": "error",
  "message": "Unauthorized",
  "code": 401
}
CodeMessageWhat to do
401UnauthorizedCheck that the token is present and correct. Request a new token if it has expired.
400Invalid date format. Use YYYY-MM-DDSend the date as YYYY-MM-DD, for example 2026-04-21.
400Invalid user_idSend a valid UUID.
400Page and limit must be integers ≥ 1Send page and limit as whole numbers of 1 or more.
500Internal server errorWait a moment and retry. If it keeps happening, contact TeamTrace support.


Validate before you send

You can catch most 400 errors by checking your values in code first.

function isValidDate(date) {
  return /^\d{4}-\d{2}-\d{2}$/.test(date);
}

function isUUID(id) {
  return /^[0-9a-fA-F-]{36}$/.test(id);
}

Retry on failures

If a request fails because of a network problem, you can retry it a few times before giving up.

async function fetchWithRetry(url, options, retries = 3) {
  try {
    const res = await fetch(url, options);
    return res;
  } catch (err) {
    if (retries > 0) {
      return fetchWithRetry(url, options, retries - 1);
    }
    throw err;
  }
}

Tips

  • Start with the authorization request. Confirm you can get a token before you test anything else.
  • Match the method. Customer List and User List use GET with filters in the URL. The others use POST with a JSON body.
  • Use YYYY-MM-DD for every date. This format is required in every request that has a date.
  • Look up IDs first. Fetch the customer list or user list to get the UUIDs the other requests need.
  • Handle empty results. An empty list is a valid response, not an error.
  • Keep your token and secret private. Never put them in front-end code or share them in public places.


Notes

  • Requests with a JSON body need the Content-Type: application/json header.
  • In the Customer List request, customer_status is required. In the Customer Task List request, uuid is required.
  • In the timesheet requests, page and limit are required. In the other list requests, they are optional.
  • If you don't send page and limit where they are optional, default values from the server may be used.


Troubleshooting

ProblemWhat to check
I get 401 UnauthorizedCheck that the authorization header is present and holds a valid token. Request a new token if it has expired.
I get an invalid date errorUse the YYYY-MM-DD format, for example 2026-04-21.
I get an invalid user_id errorSend a valid UUID. Get it from the user list.
I get a page and limit errorSend both as whole numbers of 1 or more, and put them in the URL, not in the body.
The Customer List request failsAdd customer_status with the value ACTIVE or INACTIVE.
The Customer Task List request failsAdd a valid customer uuid to the JSON body.
My POST request body is ignoredAdd the Content-Type: application/json header and send valid JSON.
The response is emptyCheck your filters and the date. An empty list means no records match.
I get a 500 errorWait a moment and retry. If it keeps happening, contact TeamTrace support.


Related Articles

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article