latestOpenAPI 3.0.12026-08-192092911.2 MB

916e669fc527

Timesheets

Create a timesheet activity for a resource

Create a new timesheet activity for a resource. For StartWork events, a subsequent EndWork will set this record's end date. For EndWork events, the startedAt timestamp is applied as the end date of the most recent preceding StartWork record with no end date. (required scope resources:write)

post/v1/resources/{resourceId}/timesheets

Path parameters

resourceIdinteger required

The ID of the resource

Headers

Customer-Idinteger required

The customer identifier

Request body

eventType'startWork' | 'endWork'

The type of timesheet event being recorded<p>Possible values:</p><ul><li><b>startWork</b>: Start of a work period. When a subsequent EndWork event is recorded, its</li><li><b>endWork</b>: End of a work period. When recorded, the</li></ul>

startedAtstring date-time

Represents a DateTime value from a write endpoint that accepts a raw string,<br/>deferring parsing so that invalid values can be reported via FluentValidation<br/>rather than a model-binding error

endedAtstring date-time

Represents a DateTime value from a write endpoint that accepts a raw string,<br/>deferring parsing so that invalid values can be reported via FluentValidation<br/>rather than a model-binding error

Example request

{
  "eventType": "startWork"
}

Response

Created

idinteger

Identifier of the newly created record