{"openapi":"3.1.0","info":{"title":"POST /api/v1/time-entries","version":"1.0.0","description":"Create time entry"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/time-entries":{"post":{"tags":["time-entries"],"summary":"Create time entry","description":"Log a new time entry.","operationId":"create_time_entry_api_v1_time_entries_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeEntryCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeEntryResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"TimeEntryCreateRequest":{"properties":{"entry_date":{"type":"string","format":"date","title":"Entry Date","description":"Date the work was performed."},"duration_minutes":{"type":"integer","exclusiveMinimum":0.0,"title":"Duration Minutes","description":"Duration in minutes."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description."},"person_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Name","description":"Who performed the work."},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Customer worked for."},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project / job."},"catalog_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Item Id","description":"Service item to use as the invoice line."},"billable":{"type":"boolean","title":"Billable","description":"Whether the time is billable.","default":true},"rate_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Rate Cents","description":"Billing rate per hour, in cents."}},"type":"object","required":["entry_date","duration_minutes"],"title":"TimeEntryCreateRequest","description":"Request schema for creating a time entry."},"TimeEntryResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"entry_date":{"type":"string","format":"date","title":"Entry Date"},"duration_minutes":{"type":"integer","title":"Duration Minutes"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"person_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Name"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"project_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Name"},"catalog_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Item Id"},"billable":{"type":"boolean","title":"Billable"},"rate_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rate Cents"},"billable_amount":{"type":"integer","title":"Billable Amount","description":"Computed billable amount in cents.","default":0},"status":{"type":"string","title":"Status"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","entry_date","duration_minutes","billable","status","is_active","created_at","updated_at"],"title":"TimeEntryResponse","description":"Response schema for a time entry."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}