{"openapi":"3.0.0","paths":{"/v1/checklists":{"get":{"operationId":"PublicChecklistsController_list","parameters":[{"name":"created_after","required":false,"in":"query","description":"Filter checklists created after ISO datetime","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter by checklist status","schema":{"type":"string"}},{"name":"unit_id","required":false,"in":"query","description":"Filter by unit ID","schema":{"type":"number"}},{"name":"per_page","required":false,"in":"query","description":"Items per page, max 100 (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated list of checklists in the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":10},"title":{"type":"string","example":"Abertura da Loja"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"is_recurring":{"type":"boolean","example":false},"unit_id":{"type":"integer","example":1},"sector_id":{"type":"integer","example":495},"moment_id":{"type":"integer","example":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"page":{"type":"integer","example":1},"per_page":{"type":"integer","example":20},"total":{"type":"integer","example":42},"total_pages":{"type":"integer","example":3}}}}}}}},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"List checklists","tags":["Checklists"]},"post":{"operationId":"PublicChecklistsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"unit_id":{"type":"integer"},"sector_id":{"type":"integer"},"moment_id":{"type":"integer"},"description":{"type":"string","nullable":true},"user_id":{"type":"string","format":"uuid","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"is_recurring":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"item-1"},"type":{"type":"string","enum":["check","evaluative","text","datetime","numeric","selection_list","gps","barcode_qrcode","separator","signature"]},"title":{"type":"string","example":"Confirmar abertura"},"description":{"type":"string","nullable":true,"example":"Verificar se a loja está pronta"},"required":{"type":"boolean","example":true},"weight":{"type":"number","example":1},"order":{"type":"integer","example":0},"label_negative":{"type":"string","nullable":true,"example":"Não Feito"},"label_positive":{"type":"string","nullable":true,"example":"Feito"},"is_critical":{"type":"boolean","example":false},"has_goal":{"type":"boolean","example":false},"config":{"type":"object","additionalProperties":true,"example":{"negative_label":"Não Feito","positive_label":"Feito"}},"evidences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"ev-1"},"label":{"type":"string","example":"Foto da abertura"},"type":{"type":"string","enum":["image","video","text","signature"]},"required":{"type":"string","enum":["required","optional"]}}}}}}},"schedule_start_date":{"type":"string","format":"date-time","nullable":true},"schedule_end_date":{"type":"string","format":"date-time","nullable":true},"schedule_recurrence_type":{"type":"string","nullable":true,"enum":["one-time","daily","weekly","monthly","custom"]},"schedule_interval":{"type":"integer","nullable":true},"schedule_day_of_week":{"type":"object","properties":{"dayOfWeek":{"type":"array","items":{"type":"integer"}}}},"schedule_exceptions":{"type":"object","properties":{"exceptions":{"type":"array","items":{"type":"string"}}}},"usage_policy":{"oneOf":[{"type":"object","additionalProperties":true,"properties":{"location":{"type":"object","additionalProperties":true,"properties":{"is_active":{"type":"boolean"},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"radius_m":{"type":"number","nullable":true}}},"timing":{"type":"object","additionalProperties":true,"properties":{"mode":{"type":"string","nullable":true},"early":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}},"late":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}}}},"block_navigation":{"type":"boolean","nullable":true}}},{"type":"object","properties":{"require_location":{"type":"boolean"},"location_lat":{"type":"number","nullable":true},"location_lng":{"type":"number","nullable":true},"location_radius_meters":{"type":"number","nullable":true},"time_window_before_minutes":{"type":"number","nullable":true},"time_window_after_minutes":{"type":"number","nullable":true}}}]}},"required":["title","unit_id","sector_id","moment_id"]}}}},"responses":{"201":{"description":"Checklist created in the token workspace","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"integer","example":10},"title":{"type":"string","example":"Abertura da Loja"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"is_recurring":{"type":"boolean","example":false},"unit_id":{"type":"integer","example":1},"sector_id":{"type":"integer","example":495},"moment_id":{"type":"integer","example":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},{"type":"object","properties":{"user_id":{"type":"string","format":"uuid","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"item-1"},"type":{"type":"string","enum":["check","evaluative","text","datetime","numeric","selection_list","gps","barcode_qrcode","separator","signature"]},"title":{"type":"string","example":"Confirmar abertura"},"description":{"type":"string","nullable":true,"example":"Verificar se a loja está pronta"},"required":{"type":"boolean","example":true},"weight":{"type":"number","example":1},"order":{"type":"integer","example":0},"label_negative":{"type":"string","nullable":true,"example":"Não Feito"},"label_positive":{"type":"string","nullable":true,"example":"Feito"},"is_critical":{"type":"boolean","example":false},"has_goal":{"type":"boolean","example":false},"config":{"type":"object","additionalProperties":true,"example":{"negative_label":"Não Feito","positive_label":"Feito"}},"evidences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"ev-1"},"label":{"type":"string","example":"Foto da abertura"},"type":{"type":"string","enum":["image","video","text","signature"]},"required":{"type":"string","enum":["required","optional"]}}}}}}},"usage_policy":{"type":"object","additionalProperties":true,"properties":{"location":{"type":"object","additionalProperties":true,"properties":{"is_active":{"type":"boolean"},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"radius_m":{"type":"number","nullable":true}}},"timing":{"type":"object","additionalProperties":true,"properties":{"mode":{"type":"string","nullable":true},"early":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}},"late":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}}}},"block_navigation":{"type":"boolean","nullable":true}}},"schedule_start_date":{"type":"string","format":"date-time","nullable":true},"schedule_end_date":{"type":"string","format":"date-time","nullable":true},"schedule_recurrence_type":{"type":"string","nullable":true,"enum":["one-time","daily","weekly","monthly","custom"]},"schedule_interval":{"type":"integer","nullable":true},"schedule_day_of_week":{"type":"object","properties":{"dayOfWeek":{"type":"array","items":{"type":"integer"}}}},"schedule_exceptions":{"type":"object","properties":{"exceptions":{"type":"array","items":{"type":"string"}}}}}}]}}}},"403":{"description":"Token creator does not have write permission by scope or RLS"},"404":{"description":"Unit not found in the token workspace"},"422":{"description":"Invalid request body"}},"security":[{"api-token":[]}],"summary":"Create checklist","tags":["Checklists"]}},"/v1/checklists/{id}":{"get":{"operationId":"PublicChecklistsController_getById","parameters":[{"name":"id","required":true,"in":"path","description":"Checklist numeric ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Checklist found in the token workspace","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"integer","example":10},"title":{"type":"string","example":"Abertura da Loja"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"is_recurring":{"type":"boolean","example":false},"unit_id":{"type":"integer","example":1},"sector_id":{"type":"integer","example":495},"moment_id":{"type":"integer","example":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},{"type":"object","properties":{"user_id":{"type":"string","format":"uuid","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"item-1"},"type":{"type":"string","enum":["check","evaluative","text","datetime","numeric","selection_list","gps","barcode_qrcode","separator","signature"]},"title":{"type":"string","example":"Confirmar abertura"},"description":{"type":"string","nullable":true,"example":"Verificar se a loja está pronta"},"required":{"type":"boolean","example":true},"weight":{"type":"number","example":1},"order":{"type":"integer","example":0},"label_negative":{"type":"string","nullable":true,"example":"Não Feito"},"label_positive":{"type":"string","nullable":true,"example":"Feito"},"is_critical":{"type":"boolean","example":false},"has_goal":{"type":"boolean","example":false},"config":{"type":"object","additionalProperties":true,"example":{"negative_label":"Não Feito","positive_label":"Feito"}},"evidences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"ev-1"},"label":{"type":"string","example":"Foto da abertura"},"type":{"type":"string","enum":["image","video","text","signature"]},"required":{"type":"string","enum":["required","optional"]}}}}}}},"usage_policy":{"type":"object","additionalProperties":true,"properties":{"location":{"type":"object","additionalProperties":true,"properties":{"is_active":{"type":"boolean"},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"radius_m":{"type":"number","nullable":true}}},"timing":{"type":"object","additionalProperties":true,"properties":{"mode":{"type":"string","nullable":true},"early":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}},"late":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}}}},"block_navigation":{"type":"boolean","nullable":true}}},"schedule_start_date":{"type":"string","format":"date-time","nullable":true},"schedule_end_date":{"type":"string","format":"date-time","nullable":true},"schedule_recurrence_type":{"type":"string","nullable":true,"enum":["one-time","daily","weekly","monthly","custom"]},"schedule_interval":{"type":"integer","nullable":true},"schedule_day_of_week":{"type":"object","properties":{"dayOfWeek":{"type":"array","items":{"type":"integer"}}}},"schedule_exceptions":{"type":"object","properties":{"exceptions":{"type":"array","items":{"type":"string"}}}}}}]}}}},"404":{"description":"Checklist not found in the token workspace"}},"security":[{"api-token":[]}],"summary":"Get checklist by ID","tags":["Checklists"]},"patch":{"operationId":"PublicChecklistsController_update","parameters":[{"name":"id","required":true,"in":"path","description":"Checklist numeric ID","schema":{"type":"number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"unit_id":{"type":"integer"},"sector_id":{"type":"integer"},"moment_id":{"type":"integer"},"description":{"type":"string","nullable":true},"user_id":{"type":"string","format":"uuid","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"is_recurring":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"item-1"},"type":{"type":"string","enum":["check","evaluative","text","datetime","numeric","selection_list","gps","barcode_qrcode","separator","signature"]},"title":{"type":"string","example":"Confirmar abertura"},"description":{"type":"string","nullable":true,"example":"Verificar se a loja está pronta"},"required":{"type":"boolean","example":true},"weight":{"type":"number","example":1},"order":{"type":"integer","example":0},"label_negative":{"type":"string","nullable":true,"example":"Não Feito"},"label_positive":{"type":"string","nullable":true,"example":"Feito"},"is_critical":{"type":"boolean","example":false},"has_goal":{"type":"boolean","example":false},"config":{"type":"object","additionalProperties":true,"example":{"negative_label":"Não Feito","positive_label":"Feito"}},"evidences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"ev-1"},"label":{"type":"string","example":"Foto da abertura"},"type":{"type":"string","enum":["image","video","text","signature"]},"required":{"type":"string","enum":["required","optional"]}}}}}}},"schedule_start_date":{"type":"string","format":"date-time","nullable":true},"schedule_end_date":{"type":"string","format":"date-time","nullable":true},"schedule_recurrence_type":{"type":"string","nullable":true,"enum":["one-time","daily","weekly","monthly","custom"]},"schedule_interval":{"type":"integer","nullable":true},"schedule_day_of_week":{"type":"object","properties":{"dayOfWeek":{"type":"array","items":{"type":"integer"}}}},"schedule_exceptions":{"type":"object","properties":{"exceptions":{"type":"array","items":{"type":"string"}}}},"usage_policy":{"oneOf":[{"type":"object","additionalProperties":true,"properties":{"location":{"type":"object","additionalProperties":true,"properties":{"is_active":{"type":"boolean"},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"radius_m":{"type":"number","nullable":true}}},"timing":{"type":"object","additionalProperties":true,"properties":{"mode":{"type":"string","nullable":true},"early":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}},"late":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}}}},"block_navigation":{"type":"boolean","nullable":true}}},{"type":"object","properties":{"require_location":{"type":"boolean"},"location_lat":{"type":"number","nullable":true},"location_lng":{"type":"number","nullable":true},"location_radius_meters":{"type":"number","nullable":true},"time_window_before_minutes":{"type":"number","nullable":true},"time_window_after_minutes":{"type":"number","nullable":true}}}]}},"minProperties":1}}}},"responses":{"200":{"description":"Checklist updated in the token workspace","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"integer","example":10},"title":{"type":"string","example":"Abertura da Loja"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"is_recurring":{"type":"boolean","example":false},"unit_id":{"type":"integer","example":1},"sector_id":{"type":"integer","example":495},"moment_id":{"type":"integer","example":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},{"type":"object","properties":{"user_id":{"type":"string","format":"uuid","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"item-1"},"type":{"type":"string","enum":["check","evaluative","text","datetime","numeric","selection_list","gps","barcode_qrcode","separator","signature"]},"title":{"type":"string","example":"Confirmar abertura"},"description":{"type":"string","nullable":true,"example":"Verificar se a loja está pronta"},"required":{"type":"boolean","example":true},"weight":{"type":"number","example":1},"order":{"type":"integer","example":0},"label_negative":{"type":"string","nullable":true,"example":"Não Feito"},"label_positive":{"type":"string","nullable":true,"example":"Feito"},"is_critical":{"type":"boolean","example":false},"has_goal":{"type":"boolean","example":false},"config":{"type":"object","additionalProperties":true,"example":{"negative_label":"Não Feito","positive_label":"Feito"}},"evidences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"ev-1"},"label":{"type":"string","example":"Foto da abertura"},"type":{"type":"string","enum":["image","video","text","signature"]},"required":{"type":"string","enum":["required","optional"]}}}}}}},"usage_policy":{"type":"object","additionalProperties":true,"properties":{"location":{"type":"object","additionalProperties":true,"properties":{"is_active":{"type":"boolean"},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true},"radius_m":{"type":"number","nullable":true}}},"timing":{"type":"object","additionalProperties":true,"properties":{"mode":{"type":"string","nullable":true},"early":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}},"late":{"type":"object","additionalProperties":true,"properties":{"allowed":{"type":"boolean"},"unit":{"type":"string","nullable":true},"max_time":{"type":"number","nullable":true},"max_hours":{"type":"number","nullable":true}}}}},"block_navigation":{"type":"boolean","nullable":true}}},"schedule_start_date":{"type":"string","format":"date-time","nullable":true},"schedule_end_date":{"type":"string","format":"date-time","nullable":true},"schedule_recurrence_type":{"type":"string","nullable":true,"enum":["one-time","daily","weekly","monthly","custom"]},"schedule_interval":{"type":"integer","nullable":true},"schedule_day_of_week":{"type":"object","properties":{"dayOfWeek":{"type":"array","items":{"type":"integer"}}}},"schedule_exceptions":{"type":"object","properties":{"exceptions":{"type":"array","items":{"type":"string"}}}}}}]}}}},"403":{"description":"Token creator does not have write permission by scope or RLS"},"404":{"description":"Checklist not found in the token workspace"},"422":{"description":"Invalid request body"}},"security":[{"api-token":[]}],"summary":"Update checklist","tags":["Checklists"]}},"/v1/inventory/items":{"get":{"operationId":"PublicInventoryController_listItems","parameters":[{"name":"updated_after","required":false,"in":"query","description":"Only items updated at or after this ISO timestamp","schema":{"type":"string"}},{"name":"active","required":false,"in":"query","description":"Filter by active flag","schema":{"type":"boolean"}},{"name":"category_id","required":false,"in":"query","description":"Filter by inventory category ID (the response names the category, it does not return the id)","schema":{"type":"number"}},{"name":"per_page","required":false,"in":"query","description":"Items per page, max 100 (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated list of items in the token workspace"},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"List inventory items","tags":["Inventory"]}},"/v1/inventory/items/{id}":{"get":{"operationId":"PublicInventoryController_getItemById","parameters":[{"name":"id","required":true,"in":"path","description":"Item numeric ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Item found in the token workspace"},"404":{"description":"Item not found in the token workspace"}},"security":[{"api-token":[]}],"summary":"Get inventory item by ID","tags":["Inventory"]}},"/v1/inventory/balances":{"get":{"operationId":"PublicInventoryController_listBalances","parameters":[{"name":"unit_id","required":false,"in":"query","description":"Filter by unit","schema":{"type":"number"}},{"name":"sector_id","required":false,"in":"query","description":"Filter by sector (the stock place, with unit_id)","schema":{"type":"number"}},{"name":"item_id","required":false,"in":"query","description":"Filter by inventory item","schema":{"type":"number"}},{"name":"per_page","required":false,"in":"query","description":"Items per page, max 100 (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated balances the token owner can reach (RLS narrows by unit)"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"List stock balances by item and sector","tags":["Inventory"]}},"/v1/inventory/movements":{"get":{"operationId":"PublicInventoryController_listMovements","parameters":[{"name":"created_after","required":false,"in":"query","description":"Only movements created at or after this ISO timestamp","schema":{"type":"string"}},{"name":"movement_type","required":false,"in":"query","description":"purchase_receipt, manual_entry, manual_exit, consumption, transfer_in, transfer_out, count_adjustment, loss or correction","schema":{"type":"string"}},{"name":"unit_id","required":false,"in":"query","description":"Filter by unit","schema":{"type":"number"}},{"name":"sector_id","required":false,"in":"query","description":"Filter by sector (the stock place, with unit_id)","schema":{"type":"number"}},{"name":"item_id","required":false,"in":"query","description":"Filter by inventory item","schema":{"type":"number"}},{"name":"per_page","required":false,"in":"query","description":"Items per page, max 100 (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated movements the token owner can reach (RLS narrows by unit)"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"List stock movements (audit ledger)","tags":["Inventory"]}},"/v1/responses":{"get":{"operationId":"PublicResponsesController_list","parameters":[{"name":"created_after","required":false,"in":"query","description":"Filter responses created after ISO datetime","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter by response status","schema":{"enum":["completed","in_progress"],"type":"string"}},{"name":"user_id","required":false,"in":"query","description":"Filter by user UUID","schema":{"type":"string"}},{"name":"unit_id","required":false,"in":"query","description":"Filter by unit ID","schema":{"type":"number"}},{"name":"checklist_id","required":false,"in":"query","description":"Filter by checklist ID","schema":{"type":"number"}},{"name":"per_page","required":false,"in":"query","description":"Items per page, max 100 (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated list of responses in the token workspace"},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"List responses","tags":["Responses"]}},"/v1/responses/{id}":{"get":{"operationId":"PublicResponsesController_getById","parameters":[{"name":"id","required":true,"in":"path","description":"Response numeric ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Response found in the token workspace"},"404":{"description":"Response not found in the token workspace"}},"security":[{"api-token":[]}],"summary":"Get response by ID","tags":["Responses"]}},"/v1/sectors":{"get":{"operationId":"PublicSectorsController_list","parameters":[{"name":"category_id","required":false,"in":"query","description":"Filter by category ID","schema":{"type":"number"}},{"name":"per_page","required":false,"in":"query","description":"Items per page, max 100 (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated list of sectors in the token workspace"},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"List sectors","tags":["Sectors"]}},"/v1/sectors/{id}":{"get":{"operationId":"PublicSectorsController_getById","parameters":[{"name":"id","required":true,"in":"path","description":"Sector numeric ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Sector found in the token workspace"},"404":{"description":"Sector not found in the token workspace"}},"security":[{"api-token":[]}],"summary":"Get sector by ID","tags":["Sectors"]}},"/v1/users":{"post":{"operationId":"PublicUsersController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","email","role","bindings"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120,"example":"Maria Silva"},"email":{"type":"string","format":"email","example":"maria@example.com"},"phone":{"type":"string","example":"+5511999999999"},"temp_password":{"type":"string","minLength":8,"writeOnly":true,"description":"Required only when the email does not already have a Konclui login. The account is created with confirmed email, matching the current internal flow. Never returned nor written to the request log."},"role":{"type":"string","enum":["manager","operator"]},"managed_units":{"type":"array","description":"Unit IDs assigned to the user. At least one is required for managers.","items":{"type":"integer","minimum":1},"default":[]},"bindings":{"type":"array","minItems":1,"description":"Unit and sector assignments. Both IDs must be visible to the token creator in the token workspace. Each unit can only have one primary sector.","items":{"type":"object","additionalProperties":false,"required":["unit_id","sector_id","is_primary_sector"],"properties":{"unit_id":{"type":"integer","minimum":1},"sector_id":{"type":"integer","minimum":1},"is_primary_sector":{"type":"boolean"}}}},"link_existing_login":{"type":"boolean","default":false,"description":"Attaching an email that already has a Konclui login to this workspace is a cross-tenant side effect, so it must be explicit. With false, an existing email returns 409."}}}}}},"responses":{"201":{"description":"User created or existing login added to the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Maria Silva"},"email":{"type":"string","format":"email","example":"maria@example.com"},"phone":{"type":"string","nullable":true,"example":"+5511999999999"},"role":{"type":"string","enum":["admin","manager","operator"]},"is_owner":{"type":"boolean","example":false},"managed_units":{"type":"array","description":"Unit IDs assigned to the user. At least one is required for managers.","items":{"type":"integer","minimum":1},"default":[]},"bindings":{"type":"array","minItems":0,"description":"Unit and sector assignments. Both IDs must be visible to the token creator in the token workspace. Each unit can only have one primary sector.","items":{"type":"object","additionalProperties":false,"required":["unit_id","sector_id","is_primary_sector"],"properties":{"unit_id":{"type":"integer","minimum":1},"sector_id":{"type":"integer","minimum":1},"is_primary_sector":{"type":"boolean"}}}},"created_at":{"type":"string","format":"date-time"}}}}}},"400":{"description":"A new login requires temp_password or identity creation failed"},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"403":{"description":"Read-only token or token creator cannot assign the requested role or units"},"409":{"description":"Email already has a login and link_existing_login is false, user already belongs to the workspace, or plan member limit exceeded"},"422":{"description":"Invalid request body"}},"security":[{"api-token":[]}],"summary":"Create a user or add an existing login to the token workspace","tags":["Users"]},"get":{"operationId":"PublicUsersController_list","parameters":[{"name":"created_after","required":false,"in":"query","description":"Filter users created after ISO datetime","schema":{"type":"string"}},{"name":"role","required":false,"in":"query","description":"Filter by workspace role","schema":{"type":"string"}},{"name":"per_page","required":false,"in":"query","description":"Items per page, max 100 (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated list of users in the token workspace"},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"List users","tags":["Users"]}},"/v1/users/{id}":{"patch":{"operationId":"PublicUsersController_update","parameters":[{"name":"id","required":true,"in":"path","description":"User UUID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"description":"Partial update. Email is not editable here: it changes the auth identity and has its own flow. Sending bindings replaces the whole set.","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"example":"Maria Silva"},"phone":{"type":"string","nullable":true,"example":"+5511999999999"},"role":{"type":"string","enum":["manager","operator"]},"managed_units":{"type":"array","description":"Unit IDs assigned to the user. At least one is required for managers.","items":{"type":"integer","minimum":1}},"bindings":{"type":"array","minItems":1,"description":"Unit and sector assignments. Both IDs must be visible to the token creator in the token workspace. Each unit can only have one primary sector.","items":{"type":"object","additionalProperties":false,"required":["unit_id","sector_id","is_primary_sector"],"properties":{"unit_id":{"type":"integer","minimum":1},"sector_id":{"type":"integer","minimum":1},"is_primary_sector":{"type":"boolean"}}}}}}}}},"responses":{"200":{"description":"User updated in the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Maria Silva"},"email":{"type":"string","format":"email","example":"maria@example.com"},"phone":{"type":"string","nullable":true,"example":"+5511999999999"},"role":{"type":"string","enum":["admin","manager","operator"]},"is_owner":{"type":"boolean","example":false},"managed_units":{"type":"array","description":"Unit IDs assigned to the user. At least one is required for managers.","items":{"type":"integer","minimum":1},"default":[]},"bindings":{"type":"array","minItems":0,"description":"Unit and sector assignments. Both IDs must be visible to the token creator in the token workspace. Each unit can only have one primary sector.","items":{"type":"object","additionalProperties":false,"required":["unit_id","sector_id","is_primary_sector"],"properties":{"unit_id":{"type":"integer","minimum":1},"sector_id":{"type":"integer","minimum":1},"is_primary_sector":{"type":"boolean"}}}},"created_at":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"403":{"description":"Read-only token, owner role change, or unit outside the token creator scope"},"404":{"description":"User not found in the token workspace"},"409":{"description":"Plan member limit exceeded for the new role"},"422":{"description":"Invalid request body"}},"security":[{"api-token":[]}],"summary":"Update a user in the token workspace","tags":["Users"]},"delete":{"description":"Never a hard delete. Removing the last workspace membership bans and renames the login and marks the profile with deleted_at; removing one of several memberships only removes that workspace membership and bindings. Calling it again on an already removed membership returns already_deleted: true.","operationId":"PublicUsersController_remove","parameters":[{"name":"id","required":true,"in":"path","description":"User UUID","schema":{"type":"string"}},{"name":"unlink_checklists","required":false,"in":"query","description":"Clears user_id on the active checklists of this workspace before removing (default: false)","schema":{"enum":["true","false"],"type":"string"}}],"responses":{"200":{"description":"User removed from the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","example":true},"deleted_at":{"type":"string","format":"date-time","nullable":true},"already_deleted":{"type":"boolean","example":false},"unlinked_checklists":{"type":"integer","example":0}}}}}},"400":{"description":"You cannot remove your own user"},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"403":{"description":"Read-only token, workspace owner, or user outside the token creator scope"},"404":{"description":"User not found in the token workspace"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"Remove a user from the token workspace (soft delete)","tags":["Users"]},"get":{"operationId":"PublicUsersController_getById","parameters":[{"name":"id","required":true,"in":"path","description":"User UUID","schema":{"type":"string"}}],"responses":{"200":{"description":"User found in the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Maria Silva"},"email":{"type":"string","format":"email","example":"maria@example.com"},"phone":{"type":"string","nullable":true,"example":"+5511999999999"},"role":{"type":"string","enum":["admin","manager","operator"]},"is_owner":{"type":"boolean","example":false},"managed_units":{"type":"array","description":"Unit IDs assigned to the user. At least one is required for managers.","items":{"type":"integer","minimum":1},"default":[]},"bindings":{"type":"array","minItems":0,"description":"Unit and sector assignments. Both IDs must be visible to the token creator in the token workspace. Each unit can only have one primary sector.","items":{"type":"object","additionalProperties":false,"required":["unit_id","sector_id","is_primary_sector"],"properties":{"unit_id":{"type":"integer","minimum":1},"sector_id":{"type":"integer","minimum":1},"is_primary_sector":{"type":"boolean"}}}},"created_at":{"type":"string","format":"date-time"}}}}}},"404":{"description":"User not found in the token workspace"}},"security":[{"api-token":[]}],"summary":"Get user by ID","tags":["Users"]}},"/v1/units":{"get":{"operationId":"PublicUnitsController_list","parameters":[{"name":"segment","required":false,"in":"query","description":"Filter by business segment","schema":{"type":"string"}},{"name":"state","required":false,"in":"query","description":"Filter by state","schema":{"type":"string"}},{"name":"per_page","required":false,"in":"query","description":"Items per page, max 100 (default: 20)","schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated list of units in the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Unidade Centro"},"postal_code":{"type":"string","nullable":true,"example":"80010-000"},"street":{"type":"string","nullable":true,"example":"Rua XV de Novembro"},"number":{"type":"string","nullable":true,"example":"123"},"complement":{"type":"string","nullable":true,"example":"10 andar"},"neighborhood":{"type":"string","nullable":true,"example":"Centro"},"city":{"type":"string","nullable":true,"example":"Curitiba"},"state":{"type":"string","nullable":true,"example":"PR"},"country":{"type":"string","nullable":true,"example":"Brasil"},"segment":{"type":"string","nullable":true,"example":"restaurante"},"timezone":{"type":"string","nullable":true,"example":"America/Sao_Paulo"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"page":{"type":"integer","example":1},"per_page":{"type":"integer","example":20},"total":{"type":"integer","example":42},"total_pages":{"type":"integer","example":3}}}}}}}},"401":{"description":"Missing, malformed, invalid, or revoked API token"},"422":{"description":"Invalid query parameters"}},"security":[{"api-token":[]}],"summary":"List units","tags":["Units"]},"post":{"operationId":"PublicUnitsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1},"postal_code":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"complement":{"type":"string","nullable":true},"neighborhood":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"segment":{"type":"string","nullable":true},"timezone":{"type":"string","default":"America/Sao_Paulo"}}}}}},"responses":{"201":{"description":"Unit created in the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Unidade Centro"},"postal_code":{"type":"string","nullable":true,"example":"80010-000"},"street":{"type":"string","nullable":true,"example":"Rua XV de Novembro"},"number":{"type":"string","nullable":true,"example":"123"},"complement":{"type":"string","nullable":true,"example":"10 andar"},"neighborhood":{"type":"string","nullable":true,"example":"Centro"},"city":{"type":"string","nullable":true,"example":"Curitiba"},"state":{"type":"string","nullable":true,"example":"PR"},"country":{"type":"string","nullable":true,"example":"Brasil"},"segment":{"type":"string","nullable":true,"example":"restaurante"},"timezone":{"type":"string","nullable":true,"example":"America/Sao_Paulo"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"403":{"description":"Token creator does not have write permission by scope or RLS"},"409":{"description":"Workspace unit limit exceeded for the current plan"},"422":{"description":"Invalid request body"}},"security":[{"api-token":[]}],"summary":"Create unit","tags":["Units"]}},"/v1/units/{id}":{"get":{"operationId":"PublicUnitsController_getById","parameters":[{"name":"id","required":true,"in":"path","description":"Unit numeric ID","schema":{"type":"number"}}],"responses":{"200":{"description":"Unit found in the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Unidade Centro"},"postal_code":{"type":"string","nullable":true,"example":"80010-000"},"street":{"type":"string","nullable":true,"example":"Rua XV de Novembro"},"number":{"type":"string","nullable":true,"example":"123"},"complement":{"type":"string","nullable":true,"example":"10 andar"},"neighborhood":{"type":"string","nullable":true,"example":"Centro"},"city":{"type":"string","nullable":true,"example":"Curitiba"},"state":{"type":"string","nullable":true,"example":"PR"},"country":{"type":"string","nullable":true,"example":"Brasil"},"segment":{"type":"string","nullable":true,"example":"restaurante"},"timezone":{"type":"string","nullable":true,"example":"America/Sao_Paulo"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"404":{"description":"Unit not found in the token workspace"}},"security":[{"api-token":[]}],"summary":"Get unit by ID","tags":["Units"]},"patch":{"operationId":"PublicUnitsController_update","parameters":[{"name":"id","required":true,"in":"path","description":"Unit numeric ID","schema":{"type":"number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"postal_code":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"complement":{"type":"string","nullable":true},"neighborhood":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"segment":{"type":"string","nullable":true},"timezone":{"type":"string","default":"America/Sao_Paulo"}},"minProperties":1}}}},"responses":{"200":{"description":"Unit updated in the token workspace","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Unidade Centro"},"postal_code":{"type":"string","nullable":true,"example":"80010-000"},"street":{"type":"string","nullable":true,"example":"Rua XV de Novembro"},"number":{"type":"string","nullable":true,"example":"123"},"complement":{"type":"string","nullable":true,"example":"10 andar"},"neighborhood":{"type":"string","nullable":true,"example":"Centro"},"city":{"type":"string","nullable":true,"example":"Curitiba"},"state":{"type":"string","nullable":true,"example":"PR"},"country":{"type":"string","nullable":true,"example":"Brasil"},"segment":{"type":"string","nullable":true,"example":"restaurante"},"timezone":{"type":"string","nullable":true,"example":"America/Sao_Paulo"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"403":{"description":"Token creator does not have write permission by scope or RLS"},"404":{"description":"Unit not found in the token workspace"},"422":{"description":"Invalid request body"}},"security":[{"api-token":[]}],"summary":"Update unit","tags":["Units"]}}},"info":{"title":"Konclui Public API","description":"API publica v1 do Konclui Platform. Recursos de leitura: users, units, checklists, sectors, responses e inventory (itens, saldos e movimentos). Escrita disponivel para users (criar, atualizar e remover), units e checklists. A remocao de usuario e sempre soft delete. Cada token atua como o usuario que o criou e respeita o RLS do workspace.","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"api-token":{"scheme":"bearer","bearerFormat":"API Token","type":"http","description":"Use a token no formato kc_r_... ou kc_rw_..."}},"schemas":{}}}