Public API Documentation

  • Base URL: /api/v1
  • Response Format: JSON
  • Authentication: Personal access tokens via the Authorization: Bearer <token> header
  • Pagination: List endpoints accept an optional per_page query parameter (maximum 100)

Time Entries

Method URI Description
GET /api/v1/time-entries List authenticated user's time entries
POST /api/v1/time-entries Create a new time entry
GET /api/v1/time-entries/{id} Retrieve a specific time entry
PUT/PATCH /api/v1/time-entries/{id} Update an existing time entry
DELETE /api/v1/time-entries/{id} Delete a time entry

List Time Entries

The list endpoint supports additional filters:

Parameter Description
q Search within the description field
status Filter by entry status
start Include entries on or after this YYYY-MM-DD date
end Include entries on or before this YYYY-MM-DD date

Example

curl -H "Authorization: Bearer {token}" \
  "https://example.com/api/v1/time-entries?q=meeting&status=open&start=2024-05-01&end=2024-05-31"

Create a Time Entry

curl -X POST https://example.com/api/v1/time-entries \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2024-01-15",
    "hours": 2.5,
    "project_id": 1,
    "description": "Design meeting",
    "status": "open",
    "from_time": "2024-01-15 09:00:00",
    "till_time": "2024-01-15 11:30:00"
  }'

Response (201 Created)

{
  "id": 5,
  "date": "2024-01-15",
  "hours": 2.5,
  "status": "open",
  "description": "Design meeting",
  "from_time": "2024-01-15 09:00:00",
  "till_time": "2024-01-15 11:30:00",
  "project": {
    "id": 1,
    "name": "Website Redesign",
    "description": "Revamp",
    "budget": 10000,
    "start_date": "2024-01-01",
    "end_date": "2024-12-31"
  }
}

Projects

Method URI Description
GET /api/v1/projects List projects for the user's company
POST /api/v1/projects Create a project
GET /api/v1/projects/{id} Retrieve a specific project
PUT/PATCH /api/v1/projects/{id} Update a project
DELETE /api/v1/projects/{id} Delete a project

Create a Project

curl -X POST https://example.com/api/v1/projects \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Website Redesign",
    "description": "Revamp",
    "start_date": "2024-01-01",
    "end_date": "2024-12-31"
  }'

Response (201 Created)

{
  "id": 1,
  "name": "Website Redesign",
  "description": "Revamp",
  "budget": 10000,
  "start_date": "2024-01-01",
  "end_date": "2024-12-31"
}

Services

Method URI Description
GET /api/v1/services List services for the user's company
POST /api/v1/services Create a service
GET /api/v1/services/{id} Retrieve a specific service
PUT/PATCH /api/v1/services/{id} Update a service
DELETE /api/v1/services/{id} Delete a service

Create a Service

curl -X POST https://example.com/api/v1/services \
  -H "Authorization: Bearer {token}" \
  -F "name=Consulting" \
  -F "description=Hourly consulting" \
  -F "file=@consulting.pdf"

Response (201 Created)

{
  "id": 1,
  "name": "Consulting",
  "description": "Hourly consulting",
  "original_name": "consulting.pdf",
  "file_path": "https://example.com/storage/services/consulting.pdf"
}