# Logging Work via the API (https://jetheads.io/help-center/fundamentals/jettime/integrations/logging-work-via-the-api/)

Due to our privacy-first approach, detailed in [this article](/help-center/fundamentals/jettime/integrations/privacy-first-approach-to-data-integration/), you must use the Jira REST API to create work logs. When creating work logs, you can also include JetTime-specific metadata as part of the work log properties. For details on JetTime metadata, refer to [JetTime Work Log Metadata](/help-center/fundamentals/jettime/integrations/jettime-work-log-metadata/) article.

To create work logs, refer to the Jira API documentation for [creating work logs via POST](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-post).

<Callout type="warn">
JetTime's locks don't apply to the Jira REST API. Your integration can still create, edit or delete a work log in a submitted, approved or closed period, or on or before a [Lock Date](/help-center/fundamentals/jettime/administration/locking-work-logs-with-lock-dates/). See [What Gets Locked](/help-center/fundamentals/jettime/work-approvals/introduction-to-work-approvals/#what-gets-locked).
</Callout>

## Example JSON Body [#example-json-body]

```json
{
  "comment": {
    "content": [
      {
        "content": [
          {
            "text": "I did some work here.",
            "type": "text"
          }
        ],
        "type": "paragraph"
      }
    ],
    "type": "doc",
    "version": 1
  },
  "started": "2025-01-02T13:04:16.208+0000",
  "timeSpentSeconds": 3600,
  "properties": [
    {
      "key": "jettime",
      "value": {
        "schemaVersion": 2,
        "timeSpentSeconds": {
          "BILLABLE": 600
        },
        "fields": {
          "EXPENSE": 240.45,
          "INTERNAL": false,
          "WORK_TYPE": "Consulting"
        },
        "account": {
          "name": "Acme Corp",
          "key": "ACME"
        },
        "team": {
          "name": "Mobile Developers",
          "key": "MOBILE"
        },
        "functionRole": {
          "name": "QA",
          "key": "QA"
        },
        "timeZone": "Europe/Berlin"
      }
    }
  ]
}
```

## Explanation of Key Fields [#explanation-of-key-fields]

- `timeSpentSeconds` (top level). **Regular Time**, Jira's own time spent. For a Regular Time of zero, send `0` here and add `"REGULAR": 0` to the property's `timeSpentSeconds` — a `0` without `"REGULAR": 0` reads as Regular Time left empty ([why](/help-center/fundamentals/jettime/integrations/jettime-work-log-metadata/#2-custom-time-categories)).
- `BILLABLE`. This key under `timeSpentSeconds` represents a custom time category. Custom time category keys, such as `BILLABLE`, are [defined in the JetTime app UI](/help-center/fundamentals/jettime/administration/defining-custom-time-categories/) when you create the category, along with its other parameters (for example, display name and attributes). Send the category's seconds, or `null` when nothing was entered.
- `fields`. These keys represent custom work log fields [configured in the JetTime app UI](/help-center/fundamentals/jettime/administration/setting-up-custom-work-log-fields/). Each key, such as `EXPENSE`, `INTERNAL`, or `WORK_TYPE`, is defined in the UI when the custom work log field is created, alongside its type (for example, numeric, text, boolean). A numeric field with nothing entered takes `null`:
  - `EXPENSE`. Tracks financial expenses in numeric values.
  - `INTERNAL`. A boolean field indicating whether the work is internal or external.
  - `WORK_TYPE`. A text field describing the type of work performed (for example, `Consulting`).
- `account`. Represents the client or project account, defined in JetTime's [Accounts section](/help-center/fundamentals/jettime/organizing-work/accounts/), with attributes like `name` and `key`.
- `team`. The [team](/help-center/fundamentals/jettime/organizing-work/teams/) the work was logged under, with the same `name` and `key` attributes.
- `functionRole`. The [function role](/help-center/fundamentals/jettime/administration/function-roles/) the work was done under, again as `name` and `key`. Together with the team, this is what lets a report split one person's hours across the roles they play.
- `timeZone`. The time zone the work was done in, as an IANA time zone name such as `Europe/Berlin` ([details](/help-center/fundamentals/jettime/integrations/jettime-work-log-metadata/)). JetTime shows the work log on that zone's day and clock; `started` stays the true moment with its offset. Leave it out and JetTime uses the author's Jira profile time zone.

Write the `key` of an account, team, or role that exists in the app — that is what JetTime matches on, and an unknown key leaves the entry with no account, team, or role attached. Set `null`, or leave the field out, when there is none. The `name` is stored alongside as a readable snapshot and is never read back, so it does not have to be kept in sync.

The work log author is the native Jira author, the account the work log is created as. To log work for someone else, see [Managing Work Logs for Others via the API](/help-center/fundamentals/jettime/integrations/managing-work-logs-for-others-via-the-api/).
