Skip to main content
POST
/
hours
Post hours
curl --request POST \
  --url https://api.projectcor.com/v1/hours \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "task_log_id": 123,
  "start": "2023-11-07T05:31:56Z",
  "stop": "2023-11-07T05:31:56Z"
}
'
{
  "id": 123,
  "start": "2023-11-07T05:31:56Z",
  "stop": "2023-11-07T05:31:56Z",
  "duration": "<string>",
  "cost": 123,
  "user_id": 123,
  "task_log_id": 123,
  "project_id": 123,
  "client_id": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "status": "pending",
  "status_changed_by": 123,
  "status_changed_at": "2023-11-07T05:31:56Z",
  "type": "<string>",
  "task_log_rework_id": 123,
  "comments": "<string>",
  "user": {
    "id": 123,
    "first_name": "<string>",
    "last_name": "<string>",
    "picture": "<string>",
    "remaining_hours": 123,
    "timezone": "<string>",
    "gmt": "<string>"
  },
  "client": {},
  "project": {},
  "task": {
    "id": 123,
    "title": "<string>",
    "project_id": 123,
    "task_father": 123,
    "status": "<string>",
    "father": {
      "id": 123,
      "title": "<string>"
    },
    "project": {
      "id": 123,
      "name": "<string>",
      "client_id": 123,
      "contract_id": 123,
      "client": {
        "id": 123,
        "name": "<string>",
        "client_status_id": 123
      },
      "has_expired_contract": true
    },
    "labels": [
      {
        "id": 123,
        "hex": "<string>",
        "names": [
          {
            "name": "<string>",
            "lang": "<string>"
          }
        ]
      }
    ]
  },
  "userPosition": {},
  "billInput": {
    "id": 123,
    "entity_id": 123,
    "bill_id": 123,
    "updated_at": "2023-11-07T05:31:56Z",
    "bill": {
      "id": 123,
      "receipt_number": "<string>"
    }
  },
  "rework_hour": {
    "requested_by": "<string>",
    "description": "<string>",
    "on": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
task_log_id
integer
required

Task ID

start
string<date-time>
required

Start Timestamp

stop
string<date-time>

Stop Timestamp

Response

200 - application/json

Hours logged successfully

id
integer

Unique identifier of the time entry

start
string<date-time>

Start timestamp of the time entry

stop
string<date-time>

Stop timestamp of the time entry

duration
string

Duration of the time entry in hours

cost
number

Calculated cost for this time entry

user_id
integer

ID of the user who logged the hours

task_log_id
integer

ID of the task this time entry is logged against

project_id
integer | null

Project ID (null when the task has no associated project)

client_id
integer | null

Client ID (null when the task has no associated client)

created_at
string<date-time>

Timestamp when the time entry was created

status
enum<string>

Current approval status of the time entry

Available options:
pending,
approved,
rejected,
paid
status_changed_by
integer | null

ID of the user who last changed the status (null if status has not been changed)

status_changed_at
string<date-time> | null

Timestamp when the status was last changed (null if status has not been changed)

type
string

Type of time entry (e.g. TASK)

task_log_rework_id
integer | null

Rework ID if this time entry is associated with a rework, otherwise null

comments
string | null

Optional comments on the time entry

user
object

Summary of the user who logged the time entry

client
object

Client information (null when the task has no associated client)

project
object

Project information (null when the task has no associated project)

task
object

Task this time entry is logged against

userPosition
object

User's position information (null if not set)

billInput
object

Billing information, present when the time entry has been invoiced (status paid)

rework_hour
object

Rework details, present when task_log_rework_id is set