Skip to main content
POST
/
api
/
activity
/
activities.create
Activities : create
curl --request POST \
  --url https://api.example.com/api/activity/activities.create \
  --header 'Content-Type: application/json' \
  --data '
{
  "resource_id": "872815618512410358",
  "task_id": "872815618512410358",
  "billable": true,
  "type": "duration",
  "id": "872815618512410358",
  "date": "2019-11-11",
  "duration": "PT1H30M20S",
  "remark": "<string>",
  "start": "2019-11-11T12:34:56",
  "end": "2019-11-11T12:34:56"
}
'
{
  "id": "872815618512410358"
}

Body

application/json
resource_id
string<snowflake>
required
Example:

"872815618512410358"

task_id
string<snowflake>
required
Example:

"872815618512410358"

billable
boolean
required
type
enum<string>
required

Activity type. Determines which fields are required: duration needs date + duration, range needs start (+ optionally end).

Available options:
duration,
range
Example:

"duration"

id
string<snowflake>
Example:

"872815618512410358"

date
string<local-date>

Required when type is duration.

Example:

"2019-11-11"

duration
string<duration> | null

Required when type is duration. Must be ≤ 24h.

Example:

"PT1H30M20S"

remark
string | null
Maximum string length: 65535
start
string<local-date-time>

Required when type is range.

Example:

"2019-11-11T12:34:56"

end
string<local-date-time> | null

Required when type is range, but can be omitted for open (running) activity.

Example:

"2019-11-11T12:34:56"

Response

201 - application/json

Activity created.

id
string<snowflake>
Example:

"872815618512410358"