{
  "swagger": "2.0",
  "info": {
    "title": "Hourglass API",
    "description": "This API allows you to do everything you can do in the UI.",
    "version": "1.2.0-rc1",
    "x-docsVersion": "0625accbfdeb2ee1a764d7a60b73ed7f"
  },
  "basePath": "/hourglass",
  "securityDefinitions": {
    "api_key": {
      "type": "apiKey",
      "description": "Available on the \"my account\" page in redmine",
      "name": "key",
      "in": "query"
    }
  },
  "security": [
    {
      "api_key": [

      ]
    }
  ],
  "definitions": {
    "time_tracker_start": {
      "title": "Time tracker",
      "type": "object",
      "properties": {
        "issue_id": {
          "type": "integer",
          "minimum": 0
        },
        "comments": {
          "type": "string"
        }
      }
    },
    "time_tracker": {
      "title": "Time tracker",
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "user_id": {
          "type": "integer",
          "minimum": 0
        },
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "project_id": {
          "type": "integer",
          "minimum": 0
        },
        "activity_id": {
          "type": "integer",
          "minimum": 0
        },
        "issue_id": {
          "type": "integer",
          "minimum": 0
        },
        "comments": {
          "type": "string"
        }
      }
    },
    "time_tracker_update": {
      "title": "Time tracker",
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "user_id": {
          "type": "integer",
          "minimum": 0
        },
        "project_id": {
          "type": "integer",
          "minimum": 0
        },
        "activity_id": {
          "type": "integer",
          "minimum": 0
        },
        "issue_id": {
          "type": "integer",
          "minimum": 0
        },
        "comments": {
          "type": "string"
        }
      }
    },
    "time_log": {
      "title": "Time log",
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "user_id": {
          "type": "integer",
          "minimum": 0
        },
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "stop": {
          "type": "string",
          "format": "date-time"
        },
        "comments": {
          "type": "string"
        }
      }
    },
    "time_log_update": {
      "title": "Time log",
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "stop": {
          "type": "string",
          "format": "date-time"
        },
        "comments": {
          "type": "string"
        }
      }
    },
    "time_booking": {
      "title": "Time booking",
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "stop": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "time_booking_params": {
      "title": "Time booking",
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "stop": {
          "type": "string",
          "format": "date-time"
        },
        "user_id": {
          "type": "integer",
          "minimum": 0
        },
        "project_id": {
          "type": "integer",
          "minimum": 0
        },
        "activity_id": {
          "type": "integer",
          "minimum": 0
        },
        "issue_id": {
          "type": "integer",
          "minimum": 0
        },
        "comments": {
          "type": "string"
        }
      }
    },
    "error_msg": {
      "title": "Error",
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "index_response": {
      "title": "Records",
      "type": "object",
      "properties": {
        "count": {
          "type": "integer"
        },
        "offset": {
          "type": "integer"
        },
        "limit": {
          "type": "integer"
        },
        "records": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      }
    }
  },
  "paths": {
    "/time_bookings.json": {
      "get": {
        "summary": "Lists all visible time bookings",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time bookings"
        ],
        "responses": {
          "200": {
            "description": "time bookings found",
            "schema": {
              "$ref": "#/definitions/index_response"
            },
            "examples": {
              "application/json": {
                "count": 2,
                "offset": 0,
                "limit": 25,
                "records": [
                  {
                    "id": 4,
                    "start": "2023-02-20T21:57:07.000+13:00",
                    "stop": "2023-02-21T01:55:17.000+13:00",
                    "time_log_id": 4,
                    "time_entry_id": 4,
                    "created_at": "2023-02-21T09:06:21.748+13:00",
                    "updated_at": "2023-02-21T09:06:21.748+13:00",
                    "time_entry": {
                      "id": 4,
                      "project_id": 18,
                      "user_id": 34,
                      "issue_id": null,
                      "hours": 3.97,
                      "comments": null,
                      "activity_id": 4,
                      "spent_on": "2023-02-20",
                      "tyear": 2023,
                      "tmonth": 2,
                      "tweek": 8,
                      "created_on": "2023-02-21T09:06:21.743+13:00",
                      "updated_on": "2023-02-21T09:06:21.743+13:00",
                      "author_id": 34
                    }
                  },
                  {
                    "id": 3,
                    "start": "2023-02-20T19:21:48.000+13:00",
                    "stop": "2023-02-21T06:05:18.000+13:00",
                    "time_log_id": 3,
                    "time_entry_id": 3,
                    "created_at": "2023-02-21T09:06:21.677+13:00",
                    "updated_at": "2023-02-21T09:06:21.677+13:00",
                    "time_entry": {
                      "id": 3,
                      "project_id": 16,
                      "user_id": 32,
                      "issue_id": null,
                      "hours": 10.73,
                      "comments": null,
                      "activity_id": 3,
                      "spent_on": "2023-02-20",
                      "tyear": 2023,
                      "tmonth": 2,
                      "tweek": 8,
                      "created_on": "2023-02-21T09:06:21.671+13:00",
                      "updated_on": "2023-02-21T09:06:21.674+13:00",
                      "author_id": 32
                    }
                  }
                ]
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_bookings/{id}.json": {
      "get": {
        "summary": "Find time booking by ID",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time bookings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "time booking found",
            "schema": {
              "$ref": "#/definitions/time_booking",
              "required": [
                "id",
                "start",
                "stop",
                "created_at",
                "updated_at"
              ]
            },
            "examples": {
              "application/json": {
                "id": 19,
                "start": "2023-02-20T19:42:29.000+13:00",
                "stop": "2023-02-21T02:14:14.000+13:00",
                "time_log_id": 19,
                "time_entry_id": 19,
                "created_at": "2023-02-21T09:06:24.319+13:00",
                "updated_at": "2023-02-21T09:06:24.319+13:00",
                "time_entry": {
                  "id": 19,
                  "project_id": 48,
                  "user_id": 66,
                  "issue_id": null,
                  "hours": 6.53,
                  "comments": null,
                  "activity_id": 19,
                  "spent_on": "2023-02-20",
                  "tyear": 2023,
                  "tmonth": 2,
                  "tweek": 8,
                  "created_on": "2023-02-21T09:06:24.312+13:00",
                  "updated_on": "2023-02-21T09:06:24.315+13:00",
                  "author_id": 66
                }
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      },
      "delete": {
        "summary": "Deletes a time booking",
        "tags": [
          "Time bookings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "time booking deleted"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      },
      "put": {
        "summary": "Update an existing time booking",
        "consumes": [
          "application/json"
        ],
        "tags": [
          "Time bookings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          },
          {
            "name": "time_booking",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/time_booking_params"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "time booking found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      }
    },
    "/time_bookings/bulk_destroy.json": {
      "delete": {
        "summary": "Deletes multiple time bookings at once",
        "tags": [
          "Time bookings"
        ],
        "parameters": [
          {
            "name": "time_bookings[]",
            "in": "query",
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          }
        ],
        "responses": {
          "200": {
            "description": "time bookings found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_bookings/bulk_update.json": {
      "post": {
        "summary": "Updates multiple time bookings at once",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time bookings"
        ],
        "parameters": [
          {
            "name": "time_bookings",
            "in": "body",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/time_booking_params"
              }
            },
            "description": "takes an object of time bookings"
          }
        ],
        "responses": {
          "200": {
            "description": "time bookings found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_bookings/bulk_create.json": {
      "post": {
        "summary": "Create multiple time bookings at once",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time bookings"
        ],
        "parameters": [
          {
            "name": "time_bookings",
            "in": "body",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/time_booking_params"
              }
            },
            "description": "takes an array of time bookings"
          }
        ],
        "responses": {
          "200": {
            "description": "time bookings found"
          },
          "400": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_logs.json": {
      "get": {
        "summary": "Lists all visible time logs",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "responses": {
          "200": {
            "description": "time logs found",
            "schema": {
              "$ref": "#/definitions/index_response"
            },
            "examples": {
              "application/json": {
                "count": 2,
                "offset": 0,
                "limit": 25,
                "records": [
                  {
                    "id": 127,
                    "start": "2023-02-20T20:31:00.000+13:00",
                    "stop": "2023-02-21T05:54:00.000+13:00",
                    "user_id": 282,
                    "created_at": "2023-02-21T09:06:41.917+13:00",
                    "updated_at": "2023-02-21T09:06:41.917+13:00",
                    "hours": 9.383333333333333
                  },
                  {
                    "id": 128,
                    "start": "2023-02-20T19:12:00.000+13:00",
                    "stop": "2023-02-21T03:32:00.000+13:00",
                    "comments": "Use the wireless RSS monitor, then you can reboot the auxiliary array!",
                    "user_id": 284,
                    "created_at": "2023-02-21T09:06:41.935+13:00",
                    "updated_at": "2023-02-21T09:06:41.935+13:00",
                    "hours": 8.333333333333334
                  }
                ]
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_logs/{id}.json": {
      "get": {
        "summary": "Find time log by ID",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "time log found",
            "schema": {
              "$ref": "#/definitions/time_log",
              "required": [
                "id",
                "start",
                "stop",
                "user_id",
                "created_at",
                "updated_at"
              ]
            },
            "examples": {
              "application/json": {
                "id": 143,
                "start": "2023-02-20T19:23:00.000+13:00",
                "stop": "2023-02-21T04:43:00.000+13:00",
                "user_id": 316,
                "created_at": "2023-02-21T09:06:43.523+13:00",
                "updated_at": "2023-02-21T09:06:43.523+13:00",
                "hours": 9.333333333333334
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      },
      "delete": {
        "summary": "Deletes a time log",
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "time log deleted"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      },
      "put": {
        "summary": "Update an existing time log",
        "consumes": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          },
          {
            "name": "time_log",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/time_log_update"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "time log found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      }
    },
    "/time_logs/{id}/book.json": {
      "post": {
        "summary": "Book a time log",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          },
          {
            "name": "time_booking",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/time_booking_params"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "time log found",
            "schema": {
              "$ref": "#/definitions/time_booking",
              "required": [
                "id",
                "start",
                "stop",
                "created_at",
                "updated_at"
              ]
            },
            "examples": {
              "application/json": {
                "id": 138,
                "start": "2023-02-20T19:47:00.000+13:00",
                "stop": "2023-02-21T01:49:00.000+13:00",
                "time_log_id": 187,
                "time_entry_id": 138,
                "created_at": "2023-02-21T09:06:49.382+13:00",
                "updated_at": "2023-02-21T09:06:49.382+13:00",
                "time_entry": {
                  "id": 138,
                  "project_id": 290,
                  "user_id": 410,
                  "issue_id": null,
                  "hours": 6.03,
                  "comments": null,
                  "activity_id": 137,
                  "spent_on": "2023-02-20",
                  "tyear": 2023,
                  "tmonth": 2,
                  "tweek": 8,
                  "created_on": "2023-02-21T09:06:49.379+13:00",
                  "updated_on": "2023-02-21T09:06:49.379+13:00",
                  "author_id": 410
                }
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      }
    },
    "/time_logs/{id}/split.json": {
      "post": {
        "summary": "Split a time log",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          },
          {
            "name": "split_at",
            "in": "query",
            "type": "string",
            "format": "date-time",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "time log found",
            "schema": {
              "type": "object",
              "properties": {
                "time_log": {
                  "$ref": "#/definitions/time_log",
                  "required": [
                    "id",
                    "start",
                    "stop",
                    "user_id",
                    "created_at",
                    "updated_at"
                  ]
                },
                "new_time_log": {
                  "$ref": "#/definitions/time_log",
                  "required": [
                    "id",
                    "start",
                    "stop",
                    "user_id",
                    "created_at",
                    "updated_at"
                  ]
                }
              }
            },
            "examples": {
              "application/json": {
                "time_log": {
                  "id": 207,
                  "start": "2023-02-20T20:02:00.000+13:00",
                  "stop": "2023-02-20T20:12:00.000+13:00",
                  "user_id": 442,
                  "created_at": "2023-02-21T09:06:51.107+13:00",
                  "updated_at": "2023-02-21T09:06:51.126+13:00",
                  "hours": 0.16666666666666666
                },
                "new_time_log": {
                  "id": 208,
                  "start": "2023-02-20T20:12:00.000+13:00",
                  "stop": "2023-02-21T04:10:00.000+13:00",
                  "user_id": 442,
                  "created_at": "2023-02-21T09:06:51.128+13:00",
                  "updated_at": "2023-02-21T09:06:51.128+13:00",
                  "hours": 7.966666666666667
                }
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      }
    },
    "/time_logs/join.json": {
      "post": {
        "summary": "Joins multiple time logs",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "ids[]",
            "in": "query",
            "type": "array",
            "items": {
              "type": "integer"
            },
            "collectionFormat": "multi"
          }
        ],
        "responses": {
          "200": {
            "description": "time logs found",
            "schema": {
              "type": "object",
              "properties": {
                "time_log": {
                  "$ref": "#/definitions/time_log",
                  "required": [
                    "id",
                    "start",
                    "stop",
                    "user_id",
                    "created_at",
                    "updated_at"
                  ]
                }
              }
            },
            "examples": {
              "application/json": {
                "stop": "2023-02-21T06:26:00.000+13:00",
                "start": "2023-02-20T20:54:00.000+13:00",
                "id": 237,
                "user_id": 474,
                "created_at": "2023-02-21T09:06:52.749+13:00",
                "updated_at": "2023-02-21T09:06:52.782+13:00",
                "hours": 9.533333333333333
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          },
          "400": {
            "description": "time logs not joined",
            "schema": {
              "$ref": "#/definitions/error_msg"
            },
            "examples": {
              "application/json": {
                "message": "There are either bookings defined on the submitted time logs or the time logs start and stop doesn't match",
                "status": 400
              }
            }
          }
        }
      }
    },
    "/time_logs/bulk_destroy.json": {
      "delete": {
        "summary": "Deletes multiple time logs at once",
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "time_logs[]",
            "in": "query",
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          }
        ],
        "responses": {
          "200": {
            "description": "time logs found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_logs/bulk_update.json": {
      "post": {
        "summary": "Updates multiple time logs at once",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "time_logs",
            "in": "body",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/time_log_update"
              }
            },
            "description": "takes an object of time logs"
          }
        ],
        "responses": {
          "200": {
            "description": "time logs found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_logs/bulk_book.json": {
      "post": {
        "summary": "Books multiple time logs at once",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "time_bookings",
            "in": "body",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/time_booking_update"
              }
            },
            "description": "takes an object of time bookings"
          }
        ],
        "responses": {
          "200": {
            "description": "time logs found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_logs/bulk_create.json": {
      "post": {
        "summary": "Create multiple time logs at once",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time logs"
        ],
        "parameters": [
          {
            "name": "time_logs",
            "in": "body",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/time_log_update"
              }
            },
            "description": "takes an array of time logs"
          }
        ],
        "responses": {
          "200": {
            "description": "time logs found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_trackers.json": {
      "get": {
        "summary": "Lists all visible running time trackers",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time trackers"
        ],
        "responses": {
          "200": {
            "description": "time trackers found",
            "schema": {
              "$ref": "#/definitions/index_response"
            },
            "examples": {
              "application/json": {
                "count": 2,
                "offset": 0,
                "limit": 25,
                "records": [
                  {
                    "id": 3,
                    "start": "2023-02-21T09:07:00.000+13:00",
                    "user_id": 674,
                    "created_at": "2023-02-21T09:07:01.816+13:00",
                    "updated_at": "2023-02-21T09:07:01.816+13:00"
                  },
                  {
                    "id": 4,
                    "start": "2023-02-21T09:07:00.000+13:00",
                    "comments": "test",
                    "user_id": 676,
                    "project_id": 399,
                    "activity_id": 154,
                    "created_at": "2023-02-21T09:07:01.880+13:00",
                    "updated_at": "2023-02-21T09:07:01.880+13:00"
                  }
                ]
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_trackers/start.json": {
      "post": {
        "summary": "Starts a new time tracker",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time trackers"
        ],
        "parameters": [
          {
            "name": "time_tracker",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/time_tracker_start"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "time tracker created",
            "schema": {
              "$ref": "#/definitions/time_tracker",
              "required": [
                "id",
                "start",
                "user_id",
                "created_at",
                "updated_at"
              ]
            },
            "examples": {
              "application/json": {
                "id": 10,
                "start": "2023-02-21T09:07:00.000+13:00",
                "comments": "test",
                "user_id": 711,
                "project_id": 416,
                "created_at": "2023-02-21T09:07:04.912+13:00",
                "updated_at": "2023-02-21T09:07:04.912+13:00"
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "400": {
            "description": "time tracker not created",
            "schema": {
              "$ref": "#/definitions/error_msg"
            }
          }
        }
      }
    },
    "/time_trackers/{id}.json": {
      "get": {
        "summary": "Find time tracker by ID",
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time trackers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "time tracker found",
            "schema": {
              "$ref": "#/definitions/time_tracker",
              "required": [
                "id",
                "start",
                "user_id",
                "created_at",
                "updated_at"
              ]
            },
            "examples": {
              "application/json": {
                "id": 25,
                "start": "2023-02-21T09:07:00.000+13:00",
                "comments": "test",
                "user_id": 743,
                "created_at": "2023-02-21T09:07:06.684+13:00",
                "updated_at": "2023-02-21T09:07:06.684+13:00"
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      },
      "delete": {
        "summary": "Deletes a time tracker",
        "tags": [
          "Time trackers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "time tracker deleted"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          }
        }
      },
      "put": {
        "summary": "Update an existing time tracker",
        "consumes": [
          "application/json"
        ],
        "tags": [
          "Time trackers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          },
          {
            "name": "time_tracker",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/time_tracker_update"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "time tracker found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          },
          "400": {
            "description": "time tracker not updated",
            "schema": {
              "$ref": "#/definitions/error_msg"
            }
          }
        }
      }
    },
    "/time_trackers/{id}/stop.json": {
      "delete": {
        "summary": "Stops a time tracker and create time records from it",
        "tags": [
          "Time trackers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "time log created",
            "schema": {
              "type": "object",
              "properties": {
                "time_log": {
                  "$ref": "#/definitions/time_log",
                  "required": [
                    "id",
                    "start",
                    "stop",
                    "user_id",
                    "created_at",
                    "updated_at"
                  ]
                },
                "time_booking": {
                  "$ref": "#/definitions/time_booking",
                  "required": [
                    "id",
                    "user_id",
                    "created_at",
                    "updated_at"
                  ]
                }
              },
              "required": [
                "time_log"
              ]
            },
            "examples": {
              "application/json": {
                "time_log": {
                  "id": 345,
                  "start": "2023-02-21T09:07:00.000+13:00",
                  "stop": "2023-02-21T09:08:00.000+13:00",
                  "comments": "test",
                  "user_id": 841,
                  "created_at": "2023-02-21T09:07:12.576+13:00",
                  "updated_at": "2023-02-21T09:07:12.576+13:00",
                  "hours": 0.016666666666666666
                }
              }
            }
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          },
          "404": {
            "description": "nothing found"
          },
          "400": {
            "description": "time tracker not stopped",
            "schema": {
              "$ref": "#/definitions/error_msg"
            }
          }
        }
      }
    },
    "/time_trackers/bulk_destroy.json": {
      "delete": {
        "summary": "Deletes multiple time trackers at once",
        "tags": [
          "Time trackers"
        ],
        "parameters": [
          {
            "name": "time_trackers[]",
            "in": "query",
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          }
        ],
        "responses": {
          "200": {
            "description": "time trackers found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    },
    "/time_trackers/bulk_update.json": {
      "post": {
        "summary": "Updates multiple time trackers at once",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Time trackers"
        ],
        "parameters": [
          {
            "name": "time_trackers",
            "in": "body",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/time_tracker_update"
              }
            },
            "description": "takes an object of time trackers"
          }
        ],
        "responses": {
          "200": {
            "description": "time trackers found"
          },
          "403": {
            "description": "insufficient permissions"
          },
          "401": {
            "description": "missing or wrong api key"
          }
        }
      }
    }
  }
}