Problembehandlung

How to create or edit an expense via API

1. Min. Lesezeit

These instructions explain how to create or edit an expense using the Clockify API, which requires a specific formatting technique. Expenses are handled differently compared to other API requests in Clockify.

Steps to create/edit an expense via API #

  1. Log in to Postman: Ensure you are logged into your Postman account
  2. Create a POST (create expense) or PUT (edit expense) request:
  3. Set headers:
    • Hinzufügen X-Api-Key for authentication
    • Im Abschnitt "Team" kannst du festlegen, Content-Type die Option multipart/form-data
  4. Body format:
    • Wähle form-data instead of raw for the body type
    • Enter the following keys and corresponding values (without quotes):
      • KEY: user_id, date, project_id, category_id, notes, Betrag, abrechenbar
      • VALUE: Enter the data values directly (no quotations around the values)
  5. Send the request: After sending, check the status of the request
    • If successful, you should see a 201 Created response
    • The response will be displayed in JSON format

War der Artikel hilfreich?

Thank you! If you’d like a member of our support team to respond to you, please drop us a note at support@clockify.me