Create my time entry

Creates one explicit canonical time entry for the authenticated principal. Requires an Idempotency-Key header; inferred time is not accepted by this operation.

POST/api/v1/time-entries

Authorization

time:write_selfapi key scoperequired
Required scope when calling with an API key.

Request body

work_datestringrequired
Work date in YYYY-MM-DD form
duration_minutesnumberrequired
Explicit duration from 1 to 1440 minutes
project_idstringoptional
Project in the resolved workspace
work_item_idstringoptional
Canonical work item; DigitalStack resolves and verifies its project
category_keystringrequired
Active global or workspace time category
billable_statusstringoptional"billable" | "non_billable" | "investment"
Defaults to billable
notesstringoptional
User-supplied notes, maximum 4,000 characters
Example request
{
  "work_date": "2026-07-14",
  "duration_minutes": 90,
  "project_id": "proj_abc123",
  "category_key": "client_delivery",
  "billable_status": "billable",
  "notes": "Implemented retry handling"
}

Request

curl -X POST "https://www.digitalstack360.com/api/v1/time-entries" \
  -H "Authorization: Bearer $DS_API_KEY" \
  -H "Idempotency-Key: time-2026-07-14-client-sync" \
  -H "Content-Type: application/json" \
  -d '{"work_date":"2026-07-14","duration_minutes":90,"project_id":"proj_abc123","category_key":"client_delivery","billable_status":"billable","notes":"Implemented retry handling"}'

Examples use a placeholder key from your environment. Store your key in $DS_API_KEY — never commit it.

Response

200 OK
{
  "data": {
    "id": "time_01k2...",
    "work_date": "2026-07-14",
    "duration_minutes": 90,
    "billable_status": "billable",
    "category_key": "client_delivery",
    "notes": "Implemented retry handling",
    "target_type": "project",
    "target_id": "proj_abc123",
    "project_id": "proj_abc123",
    "status": "draft",
    "version": 1,
    "source": {
      "kind": "manual",
      "external_source": null,
      "external_id": null
    },
    "created_at": "2026-07-14T18:22:04Z",
    "updated_at": "2026-07-14T18:22:04Z"
  },
  "meta": {
    "idempotency_replayed": false,
    "self_scoped": true
  }
}

Errors

401
missing_auth

No credentials provided

401
invalid_api_key

API key is invalid or revoked

400
bad_request

Missing or invalid request fields

403
scope_insufficient

Key lacks the required write scope

400
invalid_json

Request body is not valid JSON

400
invalid_body

Request body is not a JSON object

400
self_scope_required

A caller-supplied user_id is never accepted

400
invalid_date

work_date is not a real YYYY-MM-DD calendar date

400
invalid_duration

duration_minutes is not an integer from 1 through 1440

400
category_required

category_key is missing

400
category_not_found

category_key is not active in this workspace

400
billable_status_invalid

billable_status is not an allowed value

400
notes_too_long

notes exceeds 4,000 characters

400
idempotency_key_invalid

Idempotency-Key is missing or exceeds 200 characters

403
membership_required

The caller is not an active workspace member

409
idempotency_conflict

The key was previously used with a different command

404
project_not_found

Project is not in the resolved workspace

404
target_not_found

The attributed work item or object does not exist