ConnectCloud Developers

Book own work (tenant:access and an active employee record)

POST /api/hr/v1/work-entries

Module: HR · operationId: createWorkEntry · Tag: Work entries · Auth: access token (Authorization: Bearer <accessToken>)

Always for the caller. A subject is checked with its module (400 unknown or of another customer than the customer sent, 422 subject_not_bookable, 503 subject_access_unavailable when the module cannot answer – nothing is booked); customer and project follow from it when the request names none. An origin (the call or appointment the time comes from, comms:interaction:<id> or comms:calendar:<id>) must be the caller's own (400 field origin); its entry has source interaction or calendar; the subject is then the target (a ticket, item, CRM record or project) or empty for internal work, a comms reference as subject is 400 (use origin); with an origin and no subject the customer sent wins over comms' suggestion. A call or appointment is booked once (409 already_booked); an overlap of two spans (start and end) is 409 overlap; entries without a span never overlap. An entry is a work day and a length: send minutes (1–1440) with an optional workDate (default today in the tenant's time zone, never in the future: 400 workDate), or a span startedAt + endedAt (minutes follow from it and a sent value is ignored; a workDate must be the start's day), or a startedAt with minutes and no end. An endedAt without startedAt is 400 startedAt; a start alone without minutes is 400 minutes. When the customer is not sent, it follows from the subject (a forge project's workCustomer, a desk item's customer). There is no break: it is not deducted any more. A flat-rate billing type needs an article (422 article_required). On a quota contract the consumed hours are posted to trade with the entry.

Request body

application/json (required)

  • article (WorkArticleRef): The masterdata article a flat-rate entry is billed as (requests send only id).
    • articleNumber (string): Article number
    • id (string): Id of the masterdata article
    • name (string): Name of the article
    • unit (string): Unit of the article
  • billableMinutes (integer, nullable): Default the net time (0 for flat-rate and non-billable work)
  • billing (string): Default: non-billable for internal kinds, quota on a quota contract, else the default
  • contract (WorkContractRef): A trade contract; quota contracts consume their contingent.
    • id (string): Id of the trade contract
    • number (string): Number of the contract
    • quota (boolean): A quota contract (work on it consumes its contingent)
    • title (string): Title of the contract
  • customer (WorkCustomerRef): The customer (masterdata address) the work is for.
    • id (string): Id of the customer (masterdata address)
    • name (string): Name of the customer
  • description (string): What was done
  • endedAt (string (date-time), nullable): Needs startedAt; after it, at most 24 hours later
  • kind (string): Default the tenant's default kind
  • km (number): Kilometres travelled (kinds that allow travel)
  • minutes (integer): The length; required without an end. With start and end it follows from them and a sent value is ignored (max 1440)
  • origin (string): See WorkEntry.origin; the caller's own call or appointment, checked with comms (400 field origin). Set on create, kept on update: an update may omit it or repeat it, a different one is 400 field origin
  • project (WorkProjectRef)
    • number (string): Number of the project at booking time
    • ref (string): Reference of the project in its module (desk:project:, forge:project:)
    • title (string): Title of the project at booking time
  • startedAt (string (date-time), nullable): Optional; at most 5 minutes in the future
  • state (string): suggested (draft) or confirmed (default) (one of suggested, confirmed; default "confirmed")
  • subject (string): See WorkEntry.subject; checked with its module
  • travelMinutes (integer): Travel time in minutes (kinds that allow travel)
  • version (integer): Required on change
  • workDate (string (date)): The day the work counts for (default today in the tenant's time zone); with a start it must be the start's day (or, across midnight, the end's); never in the future (400 workDate)

Example:

{
  "billing": "quota",
  "contract": {
    "id": "7a9c1e3a-5c7e-4a9c-8e3a-5c7e9a1c3e52"
  },
  "customer": {
    "id": "3c5e7a9c-1d3f-4b5a-9c7e-1a3c5e7a9c1e"
  },
  "description": "Access Point im Restaurant neu gestartet, Kanal gewechselt, Rückruf bei Frau Stadler.",
  "endedAt": "2026-11-16T09:27:00Z",
  "kind": "remote",
  "origin": "comms:interaction:4f6a8c0e-2b4d-4f6a-8c0e-2b4d6f8a0c2e",
  "startedAt": "2026-11-16T09:12:00Z",
  "state": "confirmed",
  "subject": "desk:item:6a8c0e2a-4b6d-4f8a-9c1e-3b5d7f9a1c3e",
  "workDate": "2026-11-16"
}

Responses

  • 201 Created (application/json)
  • 400 Error (application/json)
  • 403 Error (application/json)
  • 409 Error (application/json)
  • 422 Error (application/json)
  • 503 Error (application/json)

Fields of the 201 answer:

  • approvedAt (string (date-time), nullable): When the entry was approved
  • approvedBy (string): Who approved the entry (e-mail; the platform team acting in the tenant: „Plattformbetrieb (MBCOM) · “)
  • article (WorkArticleRef | null): Masterdata article a flat-rate entry is billed as
  • batchId (string (uuid), nullable): Billing batch the entry is billed in
  • billableMinutes (integer): Minutes billed
  • billedRate (number, nullable): Hourly rate (or article price) the entry was billed at
  • billing (string): Key of a billing type
  • contract (WorkContractRef | null): Trade contract that decides billing
  • correctionOf (string (uuid), nullable): The approved or billed entry this one corrects; its minutes are the difference (may be negative)
  • createdAt (string (date-time)): When the work entry was created
  • createdBy (string): Who booked the entry (e-mail)
  • customer (WorkCustomerRef | null): Customer the work is billed to
  • description (string): What was done
  • durationSeconds (integer): The exact length in seconds (the stopwatch's seconds, else minutes × 60)
  • employeeId (string (uuid)): Id of the employee
  • employeeName (string): Display name of the employee – only in listApprovableWorkEntries
  • endedAt (string (date-time), nullable): null for the running stopwatch and for an entry without a span
  • id (string (uuid)): Id of the work entry
  • kind (string): Key of a work kind (getWorkEntrySettings)
  • km (number): Kilometres travelled (kinds that allow travel)
  • minutes (integer): The length in minutes that sums and billing use (a correction's difference, may be negative; 0 for a stopwatch run that rounded to nothing)
  • origin (string): The call or appointment the time comes from: comms:interaction:<id> or comms:calendar:<id>; omitted for other work. Booked at most once per tenant (409 already_booked)
  • project (WorkProjectRef | null): Project the work counts for
  • running (boolean): The running stopwatch entry (start, no end)
  • source (string): How the entry was booked (one of manual, stopwatch, interaction, calendar, correction)
  • startedAt (string (date-time), nullable): null for an entry booked as a length only
  • state (string): suggested → confirmed → approved → billed (one of suggested, confirmed, approved, billed)
  • subject (string): What was worked on: desk:item:<id>, forge:item:<id>, crm:activity:<id>, a project desk:project:<id> / forge:project:<id>; empty for work on the customer only or internal work
  • subjectLabel (string): The subject's name at booking time (the origin's without a subject)
  • travelMinutes (integer): Travel time in minutes (kinds that allow travel)
  • updatedAt (string (date-time)): When the work entry was last changed
  • version (integer): Version for optimistic locking: send the version you read with a change (stale: 409 version_conflict)
  • workDate (string (date)): The day the work counts for (the person's choice; with a start its day in the tenant's time zone)

Example 201 answer:

{
  "approvedAt": "2026-11-17T08:05:00Z",
  "approvedBy": "martin.brandl@muster-it.example",
  "batchId": null,
  "billableMinutes": 15,
  "billedRate": null,
  "billing": "quota",
  "contract": {
    "id": "7a9c1e3a-5c7e-4a9c-8e3a-5c7e9a1c3e52",
    "number": "WV-2026-0007",
    "quota": true,
    "title": "Wartungsvertrag Netzwerk und WLAN"
  },
  "correctionOf": null,
  "createdAt": "2026-11-16T09:30:00Z",
  "createdBy": "sophie.huber@muster-it.example",
  "customer": {
    "id": "3c5e7a9c-1d3f-4b5a-9c7e-1a3c5e7a9c1e",
    "name": "Alpenhotel Seeblick GmbH"
  },
  "description": "Access Point im Restaurant neu gestartet, Kanal gewechselt, Rückruf bei Frau Stadler.",
  "durationSeconds": 900,
  "employeeId": "e5a1c3d7-2b4f-4c6e-8a0b-1d3f5b7c9e02",
  "endedAt": "2026-11-16T09:27:00Z",
  "id": "5e7a9c1e-3a5c-4e7a-9c1e-3a5c7e9a1c51",
  "kind": "remote",
  "km": 0,
  "minutes": 15,
  "origin": "comms:interaction:4f6a8c0e-2b4d-4f6a-8c0e-2b4d6f8a0c2e",
  "running": false,
  "source": "interaction",
  "startedAt": "2026-11-16T09:12:00Z",
  "state": "approved",
  "subject": "desk:item:6a8c0e2a-4b6d-4f8a-9c1e-3b5d7f9a1c3e",
  "subjectLabel": "#214 WLAN im Restaurant fällt aus",
  "travelMinutes": 0,
  "updatedAt": "2026-11-17T08:05:00Z",
  "version": 2,
  "workDate": "2026-11-16"
}

Example request

curl -X POST 'https://api.mbcom.cloud/api/hr/v1/work-entries' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"billing":"quota","contract":{"id":"7a9c1e3a-5c7e-4a9c-8e3a-5c7e9a1c3e52"},"customer":{"id":"3c5e7a9c-1d3f-4b5a-9c7e-1a3c5e7a9c1e"},"description":"Access Point im Restaurant neu gestartet, Kanal gewechselt, Rückruf bei Frau Stadler.","endedAt":"2026-11-16T09:27:00Z","kind":"remote","origin":"comms:interaction:4f6a8c0e-2b4d-4f6a-8c0e-2b4d6f8a0c2e","startedAt":"2026-11-16T09:12:00Z","state":"confirmed","subject":"desk:item:6a8c0e2a-4b6d-4f8a-9c1e-3b5d7f9a1c3e","workDate":"2026-11-16"}'

View as Markdown · Interactive reference · OpenAPI