{"openapi":"3.1.0","info":{"title":"Hecho API","version":"1.0.0","summary":"To-dos for you and your team.","description":"REST API used by the Hecho web app, the iOS/Android apps and personal integrations.\n\n**Auth**: web uses an HttpOnly cookie (`hecho_session`). Mobile sends `x-hecho-platform: ios|android` on login to receive a `token`, then `Authorization: Bearer <token>`. Personal API tokens (Settings → Integrations) work the same way.\n\n**Errors** are always `{ \"error\": { \"code\", \"message\" } }`. Messages are safe to show to users.\n\n**Money** is in USD cents. **Times** are Unix milliseconds; `due_date` is a local calendar date (YYYY-MM-DD).","contact":{"name":"Hecho support","email":"support@hechotask.com"}},"servers":[{"url":"https://hechotask.com","description":"This deployment"}],"security":[{"bearer":[]},{"cookie":[]}],"tags":[{"name":"System","description":"Health and public app configuration."},{"name":"Auth","description":"Sign up, log in (email, Google, Apple), two-step codes and password resets."},{"name":"Account","description":"Your profile, settings, devices, stats and data export."},{"name":"Security","description":"Two-step verification, sessions, connected accounts and personal API tokens."},{"name":"Projects","description":"Personal and team projects, sections and views."},{"name":"Tasks","description":"Create, list, complete and schedule tasks. Quick add understands English and Spanish."},{"name":"Comments","description":"Task conversations with @mentions."},{"name":"Labels","description":"Personal and team labels."},{"name":"Search","description":"One search box for tasks, projects, people and labels."},{"name":"Notifications","description":"Your notification inbox."},{"name":"Files","description":"Attachments and avatars."},{"name":"Realtime","description":"WebSocket updates for your account and teams."},{"name":"Teams","description":"Teams, members, roles, invites and activity."},{"name":"Invites","description":"Accept invites and join links."},{"name":"Billing","description":"Plans, entitlements and App Store / Google Play purchases."}],"paths":{"/api/health":{"get":{"tags":["System"],"summary":"Health check","operationId":"system_health_check","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"version":{"type":"string"},"time":{"type":"integer","format":"int64","description":"Unix time in milliseconds"}}}}}}}}},"/api/config":{"get":{"tags":["System"],"summary":"Public app config","description":"Read by the apps at launch.","operationId":"system_public_app_config","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"signups_open":{"type":"boolean"},"maintenance_banner":{"type":["string","null"]},"support_email":{"type":"string"},"web_checkout":{"type":"boolean"}}}}}}}}},"/api/auth/signup":{"post":{"tags":["Auth"],"summary":"Create account","description":"Sends a verification email. First user (or anyone in ADMIN_EMAILS) becomes admin.","operationId":"auth_create_account","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8,"description":"At least 8 characters and one number."},"timezone":{"type":"string"}},"required":["name","email","password"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResult"}}}},"400":{"$ref":"#/components/responses/E400"},"403":{"$ref":"#/components/responses/E403"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/auth/login":{"post":{"tags":["Auth"],"summary":"Log in with email","operationId":"auth_log_in_with_email","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/AuthResult"},{"$ref":"#/components/schemas/MfaRequired"}]}}}},"400":{"$ref":"#/components/responses/E400"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/auth/login/mfa":{"post":{"tags":["Auth"],"summary":"Finish login with 2FA","operationId":"auth_finish_login_with_2fa","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mfa_token":{"type":"string"},"code":{"type":"string","description":"6-digit TOTP"},"backup_code":{"type":"string"}},"required":["mfa_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResult"}}}},"400":{"$ref":"#/components/responses/E400"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/auth/logout":{"post":{"tags":["Auth"],"summary":"Log out","operationId":"auth_log_out","security":[{},{"bearer":[]},{"cookie":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}}}}},"/api/auth/session":{"get":{"tags":["Auth"],"summary":"Current session","operationId":"auth_current_session","security":[{},{"bearer":[]},{"cookie":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User","type":[null,"null"]}}}}}}}}},"/api/auth/verify-email":{"post":{"tags":["Auth"],"summary":"Verify email","operationId":"auth_verify_email","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"}}}},"/api/auth/verify-email/resend":{"post":{"tags":["Auth"],"summary":"Resend verification email","operationId":"auth_resend_verification_email","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/auth/password/forgot":{"post":{"tags":["Auth"],"summary":"Send reset link","description":"Always returns ok to avoid leaking which emails exist.","operationId":"auth_send_reset_link","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"429":{"$ref":"#/components/responses/E429"}}}},"/api/auth/password/reset":{"post":{"tags":["Auth"],"summary":"Reset password","operationId":"auth_reset_password","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"password":{"type":"string"},"logout_others":{"type":"boolean"}},"required":["token","password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/AuthResult"},{"$ref":"#/components/schemas/MfaRequired"}]}}}},"400":{"$ref":"#/components/responses/E400"}}}},"/api/auth/oauth/google":{"post":{"tags":["Auth"],"summary":"Sign in with Google","operationId":"auth_sign_in_with_google","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id_token":{"type":"string"}},"required":["id_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/AuthResult"},{"$ref":"#/components/schemas/MfaRequired"}]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/auth/oauth/apple":{"post":{"tags":["Auth"],"summary":"Sign in with Apple","operationId":"auth_sign_in_with_apple","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id_token":{"type":"string"},"name":{"type":"string","description":"Apple only sends the name on first sign-in."}},"required":["id_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/AuthResult"},{"$ref":"#/components/schemas/MfaRequired"}]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/auth/providers":{"get":{"tags":["Auth"],"summary":"Enabled sign-in providers","operationId":"auth_enabled_sign_in_providers","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"object","properties":{"enabled":{"type":"boolean"}}},"google":{"type":"object","properties":{"enabled":{"type":"boolean"},"web_client_id":{"type":["string","null"]}}},"apple":{"type":"object","properties":{"enabled":{"type":"boolean"},"services_id":{"type":["string","null"]}}}}}}}}}}},"/api/me":{"get":{"tags":["Account"],"summary":"My account","operationId":"account_my_account","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"settings":{"$ref":"#/components/schemas/Settings"},"entitlement":{"$ref":"#/components/schemas/Entitlement"},"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamSummary"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"patch":{"tags":["Account"],"summary":"Update profile and settings","operationId":"account_update_profile_and_settings","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settings","description":"Any subset of Settings plus `name`, `avatar_v` (1–12), `onboarding_step`."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"settings":{"$ref":"#/components/schemas/Settings"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"delete":{"tags":["Account"],"summary":"Delete my account","operationId":"account_delete_my_account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","const":"DELETE"},"password":{"type":"string"}},"required":["confirm"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"purge_after_days":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"}}}},"/api/me/avatar":{"put":{"tags":["Account"],"summary":"Upload photo","description":"Raw image body (image/png, image/jpeg, image/webp), up to 2 MB.","operationId":"account_upload_photo","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"avatar_url":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"delete":{"tags":["Account"],"summary":"Remove photo","operationId":"account_remove_photo","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/password":{"post":{"tags":["Account"],"summary":"Change password","description":"Signs out other sessions.","operationId":"account_change_password","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"current_password":{"type":"string"},"new_password":{"type":"string"}},"required":["new_password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/email":{"post":{"tags":["Account"],"summary":"Request email change","operationId":"account_request_email_change","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"pending_email":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/me/email/confirm":{"post":{"tags":["Account"],"summary":"Confirm email change","operationId":"account_confirm_email_change","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/2fa/setup":{"post":{"tags":["Security"],"summary":"Start 2FA setup","operationId":"security_start_2fa_setup","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"},"otpauth_url":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"409":{"$ref":"#/components/responses/E409"}}}},"/api/me/2fa/enable":{"post":{"tags":["Security"],"summary":"Enable 2FA","operationId":"security_enable_2fa","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"backup_codes":{"type":"array","items":{"type":"string"},"minItems":8,"maxItems":8}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/2fa/disable":{"post":{"tags":["Security"],"summary":"Disable 2FA","operationId":"security_disable_2fa","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"password":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/connect/{provider}":{"post":{"tags":["Security"],"summary":"Connect Google or Apple","operationId":"security_connect_google_or_apple","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id_token":{"type":"string"}},"required":["id_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"409":{"$ref":"#/components/responses/E409"}}},"delete":{"tags":["Security"],"summary":"Disconnect Google or Apple","description":"Refused if it would leave the account with no way to log in.","operationId":"security_disconnect_google_or_apple","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/sessions":{"get":{"tags":["Security"],"summary":"Active sessions","operationId":"security_active_sessions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/sessions/logout-others":{"post":{"tags":["Security"],"summary":"Sign out other devices","operationId":"security_sign_out_other_devices","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"ended":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/notifications/prefs":{"get":{"tags":["Account"],"summary":"Notification preferences","operationId":"account_notification_preferences","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"prefs":{"type":"array","items":{"$ref":"#/components/schemas/NotificationPref"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"put":{"tags":["Account"],"summary":"Save notification preferences","operationId":"account_save_notification_preferences","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prefs":{"type":"array","items":{"$ref":"#/components/schemas/NotificationPref"}}},"required":["prefs"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/devices":{"post":{"tags":["Account"],"summary":"Register push token","operationId":"account_register_push_token","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["ios","android","web"]},"push_token":{"type":"string"}},"required":["platform","push_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/devices/{token}":{"delete":{"tags":["Account"],"summary":"Unregister push token","operationId":"account_unregister_push_token","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/api-token":{"post":{"tags":["Security"],"summary":"Create personal API token","description":"Replaces any previous token. Shown once.","operationId":"security_create_personal_api_token","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","examples":["hecho_…"]},"note":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"delete":{"tags":["Security"],"summary":"Revoke personal API token","operationId":"security_revoke_personal_api_token","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/stats":{"get":{"tags":["Account"],"summary":"Productivity stats","operationId":"account_productivity_stats","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"today":{"type":"object","properties":{"date":{"type":"string"},"completed":{"type":"integer"},"goal":{"type":"integer"}}},"week":{"type":"object","properties":{"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"completed":{"type":"integer"},"future":{"type":"boolean"}}}},"completed":{"type":"integer"},"goal":{"type":"integer"}}},"streak_days":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/me/export":{"get":{"tags":["Account"],"summary":"Export my data (JSON)","operationId":"account_export_my_data_json","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/projects":{"get":{"tags":["Projects"],"summary":"List projects","operationId":"projects_list_projects","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"post":{"tags":["Projects"],"summary":"Create project","description":"Free plan: 5 personal projects (402 plan_limit). Gets sections To do / In progress / In review / Hecho.","operationId":"projects_create_project","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"color":{"type":"string"},"team_id":{"type":"string"},"view":{"type":"string","enum":["list","board","calendar"]},"template":{"type":"string","enum":["blank","launch","hiring"]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"402":{"$ref":"#/components/responses/E402"},"403":{"$ref":"#/components/responses/E403"}}}},"/api/projects/{id}":{"get":{"tags":["Projects"],"summary":"Get project","operationId":"projects_get_project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"sections":{"type":"array","items":{"$ref":"#/components/schemas/Section"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"team":{"type":["object","null"]},"your_role":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}},"patch":{"tags":["Projects"],"summary":"Update project","operationId":"projects_update_project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"color":{"type":"string"},"view":{"type":"string","enum":["list","board","calendar"]},"position":{"type":"number"},"status_note":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}},"delete":{"tags":["Projects"],"summary":"Archive project","operationId":"projects_archive_project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/projects/{id}/move":{"post":{"tags":["Projects"],"summary":"Move personal project into a team","operationId":"projects_move_personal_project_into_a_team","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"team_id":{"type":"string"}},"required":["team_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/projects/{id}/sections":{"post":{"tags":["Projects"],"summary":"Add section","operationId":"projects_add_section","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"position":{"type":"number"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"section":{"$ref":"#/components/schemas/Section"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/projects/{id}/sections/{sid}":{"patch":{"tags":["Projects"],"summary":"Update section","operationId":"projects_update_section","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"sid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"position":{"type":"number"},"is_done":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"section":{"$ref":"#/components/schemas/Section"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"delete":{"tags":["Projects"],"summary":"Delete section","description":"Tasks stay in the project without a section.","operationId":"projects_delete_section","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"sid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/tasks":{"get":{"tags":["Tasks"],"summary":"List tasks by view","description":"`view=today` returns `{date, overdue, today, completed_today}`; other views return `{tasks}`.","operationId":"tasks_list_tasks_by_view","parameters":[{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["today","inbox","upcoming","project","assigned","completed","label","priority"],"default":"today"}},{"name":"project_id","in":"query","required":false,"schema":{"type":"string"},"description":"view=project"},{"name":"label_id","in":"query","required":false,"schema":{"type":"string"},"description":"view=label"},{"name":"priority","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":4},"description":"view=priority"},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"view=upcoming"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":62},"description":"view=upcoming"},{"name":"include_completed","in":"query","required":false,"schema":{"type":"string","enum":["true"]},"description":"view=project"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"view":{"type":"string"},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}}},{"type":"object","properties":{"date":{"type":"string"},"overdue":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"today":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"completed_today":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}}}]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"post":{"tags":["Tasks"],"summary":"Create task","operationId":"tasks_create_task","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/Task"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/tasks/parse":{"post":{"tags":["Tasks"],"summary":"Preview quick add parsing","operationId":"tasks_preview_quick_add_parsing","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedQuickAdd"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/tasks/{id}":{"get":{"tags":["Tasks"],"summary":"Get task","operationId":"tasks_get_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"allOf":[{"$ref":"#/components/schemas/Task"},{"type":"object","properties":{"section":{"$ref":"#/components/schemas/Section","type":[null,"null"]},"created_by_user":{"$ref":"#/components/schemas/Person","type":[null,"null"]},"reminder_at":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"}}}]},"subtasks":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"followers":{"type":"array","items":{"$ref":"#/components/schemas/Person"}},"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"team_id":{"type":["string","null"]}}},"your_role":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}},"patch":{"tags":["Tasks"],"summary":"Update task","operationId":"tasks_update_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/Task"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}},"delete":{"tags":["Tasks"],"summary":"Delete task","description":"Soft delete; purged after 30 days.","operationId":"tasks_delete_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/tasks/{id}/complete":{"post":{"tags":["Tasks"],"summary":"Complete task","description":"Recurring tasks move to their next date and log a completed copy.","operationId":"tasks_complete_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/Task"},"next":{"$ref":"#/components/schemas/Task","type":[null,"null"]}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/tasks/{id}/reopen":{"post":{"tags":["Tasks"],"summary":"Reopen task","operationId":"tasks_reopen_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/Task"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/tasks/{id}/duplicate":{"post":{"tags":["Tasks"],"summary":"Duplicate task","operationId":"tasks_duplicate_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/Task"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/tasks/{id}/follow":{"post":{"tags":["Tasks"],"summary":"Follow task","operationId":"tasks_follow_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}},"delete":{"tags":["Tasks"],"summary":"Unfollow task","operationId":"tasks_unfollow_task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/tasks/{id}/comments":{"get":{"tags":["Comments"],"summary":"List comments","operationId":"comments_list_comments","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}},"post":{"tags":["Comments"],"summary":"Add comment","description":"@Name mentions notify team members.","operationId":"comments_add_comment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","maxLength":5000}},"required":["body"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/Comment"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/tasks/{id}/comments/{cid}":{"patch":{"tags":["Comments"],"summary":"Edit comment","operationId":"comments_edit_comment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string"}},"required":["body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}},"delete":{"tags":["Comments"],"summary":"Delete comment","operationId":"comments_delete_comment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/labels":{"get":{"tags":["Labels"],"summary":"List labels","operationId":"labels_list_labels","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"$ref":"#/components/schemas/Label"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"post":{"tags":["Labels"],"summary":"Create label","operationId":"labels_create_label","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":40},"color":{"type":"string"},"team_id":{"type":"string"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"label":{"$ref":"#/components/schemas/Label"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/labels/{id}":{"patch":{"tags":["Labels"],"summary":"Update label","operationId":"labels_update_label","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"color":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"label":{"$ref":"#/components/schemas/Label"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}},"delete":{"tags":["Labels"],"summary":"Delete label","operationId":"labels_delete_label","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/search":{"get":{"tags":["Search"],"summary":"Search everything","operationId":"search_search_everything","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"done","in":"query","required":false,"schema":{"type":"string","enum":["1"]},"description":"Include completed tasks"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"people":{"type":"array","items":{"$ref":"#/components/schemas/Person"}},"labels":{"type":"array","items":{"$ref":"#/components/schemas/Label"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/notifications":{"get":{"tags":["Notifications"],"summary":"List notifications","operationId":"notifications_list_notifications","parameters":[{"name":"before","in":"query","required":false,"schema":{"type":"integer"}},{"name":"unread","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"unread":{"type":"integer"},"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"next_before":{"type":["integer","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/notifications/read":{"post":{"tags":["Notifications"],"summary":"Mark as read","operationId":"notifications_mark_as_read","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"all":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/notifications/{id}":{"delete":{"tags":["Notifications"],"summary":"Dismiss notification","operationId":"notifications_dismiss_notification","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/files":{"post":{"tags":["Files"],"summary":"Upload attachment","description":"Raw body, up to 10 MB.","operationId":"files_upload_attachment","parameters":[{"name":"task_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"name":{"type":"string"},"size":{"type":"integer"},"content_type":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/files/{key}":{"get":{"tags":["Files"],"summary":"Download file","description":"Avatars are public; attachments need access to the task.","operationId":"files_download_file","security":[{},{"bearer":[]},{"cookie":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"404":{"$ref":"#/components/responses/E404"}}}},"/api/realtime":{"get":{"tags":["Realtime"],"summary":"WebSocket","description":"Upgrade to WebSocket. `room=user:<id>` (default) or `team:<id>`. Mobile may pass `?token=`. Events: `{type: \"task\"|\"project\"|\"team\"|\"notification\", action, …}`. Send \"ping\" to get \"pong\".","operationId":"realtime_websocket","parameters":[{"name":"room","in":"query","required":false,"schema":{"type":"string"}},{"name":"token","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"426":{"$ref":"#/components/responses/E426"}}}},"/api/teams":{"get":{"tags":["Teams"],"summary":"My teams","operationId":"teams_my_teams","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"teams":{"type":"array","items":{"$ref":"#/components/schemas/Team"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}},"post":{"tags":["Teams"],"summary":"Create team","description":"Starts a 14-day team trial with 5 seats.","operationId":"teams_create_team","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"icon":{"type":"string","maxLength":2},"color":{"type":"string"},"use_case":{"type":"string","enum":["product","agency","marketing","operations","school","family","other"]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/teams/{id}":{"get":{"tags":["Teams"],"summary":"Get team","operationId":"teams_get_team","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"},"members":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"invites":{"type":"array","items":{"$ref":"#/components/schemas/Invite"}},"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"seats":{"$ref":"#/components/schemas/Seats"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}},"patch":{"tags":["Teams"],"summary":"Update team","operationId":"teams_update_team","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"invite_link_enabled":{"type":"boolean"},"invite_domain":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}},"delete":{"tags":["Teams"],"summary":"Delete team","operationId":"teams_delete_team","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","description":"The team name"}},"required":["confirm"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/teams/{id}/invite-link/reset":{"post":{"tags":["Teams"],"summary":"Rotate invite link","operationId":"teams_rotate_invite_link","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"invite_link":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"}}}},"/api/teams/{id}/members/{uid}":{"patch":{"tags":["Teams"],"summary":"Change member role","operationId":"teams_change_member_role","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member","guest"]},"project_ids":{"type":"array","items":{"type":"string"},"description":"Guest-visible projects"}},"required":["role"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"402":{"$ref":"#/components/responses/E402"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}},"delete":{"tags":["Teams"],"summary":"Remove member","description":"Their open tasks become unassigned.","operationId":"teams_remove_member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/teams/{id}/leave":{"post":{"tags":["Teams"],"summary":"Leave team","operationId":"teams_leave_team","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/teams/{id}/transfer":{"post":{"tags":["Teams"],"summary":"Transfer ownership","operationId":"teams_transfer_ownership","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string"}},"required":["user_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"}}}},"/api/teams/{id}/invites":{"post":{"tags":["Teams"],"summary":"Invite by email","description":"Guests are free and need project_ids. Members/admins use seats (402 seat_limit).","operationId":"teams_invite_by_email","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string","format":"email"},"maxItems":50},"role":{"type":"string","enum":["admin","member","guest"],"default":"member"},"project_ids":{"type":"array","items":{"type":"string"}}},"required":["emails"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"invites":{"type":"array","items":{"$ref":"#/components/schemas/Invite"}},"skipped":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"402":{"$ref":"#/components/responses/E402"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/teams/{id}/invites/{iid}/resend":{"post":{"tags":["Teams"],"summary":"Resend invite","operationId":"teams_resend_invite","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"iid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/teams/{id}/invites/{iid}":{"delete":{"tags":["Teams"],"summary":"Cancel invite","operationId":"teams_cancel_invite","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"iid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/teams/{id}/activity":{"get":{"tags":["Teams"],"summary":"Team activity","operationId":"teams_team_activity","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"before","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"activity":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}},"next_before":{"type":["integer","null"]}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/teams/{id}/workload":{"get":{"tags":["Teams"],"summary":"Workload per member","operationId":"teams_workload_per_member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"open":{"type":"integer"},"overdue":{"type":"integer"},"due_today":{"type":"integer"},"done_week":{"type":"integer"}}}},"totals":{"type":"object","properties":{"open":{"type":"integer"},"unassigned":{"type":"integer"},"done_week":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/invites/{token}":{"get":{"tags":["Invites"],"summary":"Preview invite","operationId":"invites_preview_invite","security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"invite":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string"},"expires_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"has_account":{"type":"boolean"}}},"team":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"member_count":{"type":"integer"}}},"inviter":{"type":"object","properties":{"name":{"type":"string"},"avatar_v":{"type":"integer"}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"}}}},"/api/invites/{token}/accept":{"post":{"tags":["Invites"],"summary":"Accept invite","operationId":"invites_accept_invite","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"team":{"$ref":"#/components/schemas/Team"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"}}}},"/api/invites/{token}/decline":{"post":{"tags":["Invites"],"summary":"Decline invite","operationId":"invites_decline_invite","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/join/{token}":{"get":{"tags":["Invites"],"summary":"Preview invite link","operationId":"invites_preview_invite_link","security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"member_count":{"type":"integer"},"invite_domain":{"type":["string","null"]}}}}}}}},"404":{"$ref":"#/components/responses/E404"}}},"post":{"tags":["Invites"],"summary":"Join with invite link","operationId":"invites_join_with_invite_link","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"team":{"$ref":"#/components/schemas/Team"}}}}}},"401":{"$ref":"#/components/responses/E401"},"402":{"$ref":"#/components/responses/E402"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/billing/plans":{"get":{"tags":["Billing"],"summary":"Plans and store products","operationId":"billing_plans_and_store_products","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","const":"USD"},"web_checkout":{"type":"boolean"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}}}}}}}}}},"/api/billing/entitlement":{"get":{"tags":["Billing"],"summary":"What I can use","operationId":"billing_what_i_can_use","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entitlement":{"$ref":"#/components/schemas/Entitlement"},"app_account_token":{"type":"string","format":"uuid"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/billing/subscriptions":{"get":{"tags":["Billing"],"summary":"My subscriptions and receipts","operationId":"billing_my_subscriptions_and_receipts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"manage_urls":{"type":"object","properties":{"apple":{"type":"string"},"google":{"type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"}}}},"/api/billing/apple/verify":{"post":{"tags":["Billing"],"summary":"Verify App Store purchase","description":"Send `Transaction.jwsRepresentation` from StoreKit 2. Pass `team_id` when buying Team 5/10 for a team (owner/admin only).","operationId":"billing_verify_app_store_purchase","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"signed_transaction":{"type":"string"},"team_id":{"type":"string"}},"required":["signed_transaction"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseResult"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/billing/google/verify":{"post":{"tags":["Billing"],"summary":"Verify Google Play purchase","description":"Send the Play Billing purchaseToken. Set obfuscatedAccountId = app_account_token when launching the flow.","operationId":"billing_verify_google_play_purchase","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purchase_token":{"type":"string"},"team_id":{"type":"string"}},"required":["purchase_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseResult"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/billing/restore":{"post":{"tags":["Billing"],"summary":"Restore purchases","operationId":"billing_restore_purchases","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apple":{"type":"array","items":{"type":"string"}},"google":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object"}},"entitlement":{"$ref":"#/components/schemas/Entitlement"}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}},"/api/billing/promo/{code}":{"get":{"tags":["Billing"],"summary":"Check promo code","operationId":"billing_check_promo_code","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"}}}},"/api/billing/web/checkout":{"post":{"tags":["Billing"],"summary":"Web checkout (coming later)","description":"Returns 501 web_checkout_unavailable until a web gateway is connected.","operationId":"billing_web_checkout_coming_later","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"$ref":"#/components/responses/E401"},"501":{"$ref":"#/components/responses/E501"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Session token (mobile) or personal API token (`hecho_…`)."},"cookie":{"type":"apiKey","in":"cookie","name":"hecho_session"}},"responses":{"E400":{"description":"Invalid input (`validation_error`, `bad_request`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E401":{"description":"Not logged in (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E402":{"description":"Plan limit reached (`plan_limit`, `seat_limit`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E403":{"description":"Not allowed (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E426":{"description":"WebSocket upgrade required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E429":{"description":"Too many requests (`rate_limited`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E500":{"description":"Server error; stores will retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E501":{"description":"Not available yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","examples":["validation_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Person":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"avatar_v":{"type":"integer","minimum":1,"maximum":12,"description":"Built-in avatar 1–12"},"avatar_url":{"type":["string","null"]}},"required":["id","name"]},"User":{"type":"object","properties":{"id":{"type":"string","examples":["usr_8kd02mfa91ld02ms"]},"email":{"type":"string","format":"email"},"name":{"type":"string"},"avatar_v":{"type":"integer"},"avatar_url":{"type":["string","null"]},"email_verified":{"type":"boolean"},"role":{"type":"string","enum":["user","admin"]},"timezone":{"type":"string","examples":["Europe/Madrid"]},"language":{"type":"string","enum":["en","es"]},"onboarding_step":{"type":"string","enum":["avatar","plan","team","done"]},"totp_enabled":{"type":"boolean"},"has_password":{"type":"boolean"},"google_connected":{"type":"boolean"},"apple_connected":{"type":"boolean"},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"}},"required":["id","email","name"]},"Settings":{"type":"object","properties":{"timezone":{"type":"string"},"language":{"type":"string","enum":["en","es"]},"week_start":{"type":"integer","minimum":0,"maximum":6},"home_view":{"type":"string"},"date_format":{"type":"string","enum":["DD/MM/YYYY","MM/DD/YYYY","YYYY-MM-DD"]},"time_24h":{"type":"boolean"},"smart_dates":{"type":"boolean"},"completion_sound":{"type":"boolean"},"default_project":{"type":["string","null"]},"theme":{"type":"string","enum":["paper","ink","system"]},"sidebar":{"type":"string","enum":["light","dark","accent"],"description":"Web sidebar style"},"accent":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"density":{"type":"string","enum":["comfortable","compact"]},"show_counts":{"type":"boolean"},"reduce_motion":{"type":"boolean"},"daily_goal":{"type":"integer"},"weekly_goal":{"type":"integer"},"days_off":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"vacation":{"type":"boolean"},"digest_enabled":{"type":"boolean"},"digest_time":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"weekly_summary":{"type":"boolean"},"quiet_enabled":{"type":"boolean"},"quiet_start":{"type":"string"},"quiet_end":{"type":"string"},"inbox_address":{"type":["string","null"],"format":"email"},"app_account_token":{"type":"string","format":"uuid","description":"Pass as appAccountToken (StoreKit) / obfuscatedAccountId (Play Billing)."},"has_api_token":{"type":"boolean"}}},"Entitlement":{"type":"object","properties":{"plan":{"type":"string","enum":["free","pro","team5","team10"]},"pro":{"type":"boolean"},"source":{"type":["string","null"],"enum":["apple","google","web","manual","team"]},"status":{"type":["string","null"],"enum":["trial","active","grace","retry","canceled","expired","refunded","revoked"]},"renews_at":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"},"auto_renew":{"type":["boolean","null"]},"project_limit":{"type":["integer","null"],"description":"null = unlimited"}},"required":["plan","pro"]},"TeamSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","guest"]},"members":{"type":"integer"}}},"Project":{"type":"object","properties":{"id":{"type":"string","examples":["prj_d93kfa0s1mdk20sa"]},"name":{"type":"string"},"color":{"type":"string"},"view":{"type":"string","enum":["list","board","calendar"]},"is_inbox":{"type":"boolean"},"team_id":{"type":["string","null"]},"team_name":{"type":["string","null"]},"open_count":{"type":"integer"},"position":{"type":"number"},"status_note":{"type":["string","null"]},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"}},"required":["id","name"]},"Section":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"number"},"is_done":{"type":"integer","enum":[0,1],"description":"Tasks moved here count as done (board “Hecho” column)."}}},"Label":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"owner_id":{"type":["string","null"]},"team_id":{"type":["string","null"]},"open_count":{"type":"integer"}}},"Task":{"type":"object","properties":{"id":{"type":"string","examples":["tsk_0d9f8a7s6d5f4g3h"]},"project_id":{"type":"string"},"project":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"team_id":{"type":["string","null"]},"is_inbox":{"type":"boolean"}}},"section_id":{"type":["string","null"]},"parent_id":{"type":["string","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"priority":{"type":"integer","minimum":1,"maximum":4,"description":"1 = P1 (urgent) … 4 = none"},"due_date":{"type":["string","null"],"format":"date"},"due_time":{"type":["string","null"],"pattern":"^\\d{2}:\\d{2}$"},"recurrence":{"type":["string","null"],"enum":["daily","weekdays","weekly","monthly","yearly","weekly:0","weekly:1","weekly:2","weekly:3","weekly:4","weekly:5","weekly:6"]},"assignee":{"$ref":"#/components/schemas/Person","type":[null,"null"]},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}}},"subtasks":{"type":"object","properties":{"total":{"type":"integer"},"done":{"type":"integer"}}},"comments_count":{"type":"integer"},"position":{"type":"number"},"completed_at":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"},"source":{"type":"string","enum":["app","quick_add","email","api","mobile","recurrence"]},"created_by":{"type":"string"},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"updated_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"}},"required":["id","title","project_id","priority"]},"TaskInput":{"type":"object","properties":{"text":{"type":"string","maxLength":500,"description":"Quick add. Parsed for dates (EN/ES), #project, @label, +person, p1–p4 and “every …”.","examples":["Send invoice tomorrow 9am #Studio @admin p2"]},"title":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":10000},"project_id":{"type":"string","description":"Defaults to the Inbox."},"section_id":{"type":["string","null"]},"parent_id":{"type":"string","description":"Creates a sub-task."},"priority":{"type":"integer","minimum":1,"maximum":4},"due_date":{"type":["string","null"],"format":"date"},"due_time":{"type":["string","null"]},"recurrence":{"type":["string","null"]},"assignee_id":{"type":["string","null"]},"label_ids":{"type":"array","items":{"type":"string"}},"reminder_minutes":{"type":"integer","minimum":0,"maximum":10080,"description":"Minutes before due date/time."},"source":{"type":"string","enum":["app","quick_add","email","api","mobile"]}},"description":"Send either `text` or `title`."},"Comment":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"},"author":{"$ref":"#/components/schemas/Person"},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"updated_at":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"},"mentioned":{"type":"array","items":{"type":"string"},"description":"User ids notified (create only)"}}},"ParsedQuickAdd":{"type":"object","properties":{"parsed":{"type":"object","properties":{"title":{"type":"string"},"due_date":{"type":["string","null"]},"due_time":{"type":["string","null"]},"recurrence":{"type":["string","null"]},"priority":{"type":["integer","null"]},"project":{"type":["string","null"]},"labels":{"type":"array","items":{"type":"string"}},"assignee":{"type":["string","null"]},"tokens":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"kind":{"type":"string"}}}}}},"resolved":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project","type":[null,"null"]},"assignee":{"$ref":"#/components/schemas/Person","type":[null,"null"]},"labels":{"type":"array","items":{"$ref":"#/components/schemas/Label"}}}}}},"Team":{"type":"object","properties":{"id":{"type":"string","examples":["tm_a8s7d6f5g4h3j2k1"]},"name":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"owner_id":{"type":"string"},"use_case":{"type":["string","null"]},"invite_link_enabled":{"type":"boolean"},"invite_domain":{"type":["string","null"]},"invite_link":{"type":["string","null"],"format":"uri"},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"your_role":{"type":"string","enum":["owner","admin","member","guest"]}}},"Member":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"avatar_v":{"type":"integer"},"avatar_url":{"type":["string","null"]},"role":{"type":"string","enum":["owner","admin","member","guest"]},"joined_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"open_tasks":{"type":"integer"},"last_active_at":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"},"project_ids":{"type":"array","items":{"type":"string"},"description":"Guests only: projects they can see"}}},"Seats":{"type":"object","properties":{"used":{"type":"integer"},"pending":{"type":"integer"},"limit":{"type":"integer"},"plan":{"type":"string","enum":["trial","none","team5","team10"]},"status":{"type":"string"},"trial_ends_at":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"},"renews_at":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"},"store":{"type":["string","null"]}}},"Invite":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["admin","member","guest"]},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"expires_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"}}},"Activity":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","examples":["task_completed","member_joined","project_created"]},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"data":{"type":["object","null"]},"user":{"$ref":"#/components/schemas/Person"},"task":{"type":["object","null"],"properties":{"id":{"type":"string"},"title":{"type":"string"}}},"project":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}}},"Notification":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["assigned","mention","reminder","followed_done","invite","comment","team_joined","overdue"]},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"read":{"type":"boolean"},"data":{"type":["object","null"]},"actor":{"$ref":"#/components/schemas/Person","type":[null,"null"]},"task":{"type":["object","null"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"project_id":{"type":"string"}}},"team":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}}},"Plan":{"type":"object","properties":{"id":{"type":"string","enum":["free","pro","team5","team10"]},"name":{"type":"string"},"seats":{"type":"integer"},"is_team":{"type":"boolean"},"trial_days":{"type":"integer"},"project_limit":{"type":["integer","null"]},"monthly_cents":{"type":"integer","examples":[199]},"yearly_cents":{"type":"integer","examples":[1999]},"per_seat_monthly_cents":{"type":"integer"},"yearly_saving_pct":{"type":"integer"},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["pro_monthly"]},"period":{"type":"string","enum":["monthly","yearly"]},"apple_product_id":{"type":["string","null"]},"google_product_id":{"type":["string","null"]},"google_base_plan":{"type":["string","null"]}}}}}},"Subscription":{"type":"object","properties":{"id":{"type":"string"},"plan_id":{"type":"string"},"period":{"type":"string"},"store":{"type":"string","enum":["apple","google","web","manual"]},"status":{"type":"string"},"auto_renew":{"type":"integer"},"price_cents":{"type":"integer"},"currency":{"type":"string"},"started_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"trial_ends_at":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"},"current_period_end":{"type":["integer","null"],"format":"int64","description":"Unix time in milliseconds"},"team_id":{"type":["string","null"]},"team_name":{"type":["string","null"]}}},"Transaction":{"type":"object","properties":{"id":{"type":"string"},"store":{"type":"string"},"type":{"type":"string","enum":["new","renewal","upgrade","downgrade","refund","failed","trial"]},"product_id":{"type":["string","null"]},"amount_cents":{"type":"integer"},"currency":{"type":"string"},"occurred_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"}}},"PurchaseResult":{"type":"object","properties":{"subscription_id":{"type":"string"},"status":{"type":"string"},"plan_id":{"type":"string"},"entitlement":{"$ref":"#/components/schemas/Entitlement"}}},"Session":{"type":"object","properties":{"id":{"type":"string","description":"First 12 chars of the session hash"},"created_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"last_seen_at":{"type":"integer","format":"int64","description":"Unix time in milliseconds"},"user_agent":{"type":["string","null"]},"ip":{"type":["string","null"]},"platform":{"type":"string","enum":["web","ios","android"]},"current":{"type":"boolean"}}},"NotificationPref":{"type":"object","properties":{"event":{"type":"string","enum":["assigned","mention","reminder","followed_done","invite"]},"push":{"type":"boolean"},"email":{"type":"boolean"},"desktop":{"type":"boolean"}},"required":["event"]},"AuthResult":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"token":{"type":"string","description":"Only for mobile (header x-hecho-platform: ios|android). Web gets an HttpOnly cookie."}}},"MfaRequired":{"type":"object","properties":{"mfa_required":{"type":"boolean","const":true},"mfa_token":{"type":"string"}}}}}}