{"openapi":"3.1.0","info":{"title":"SmileAgile API","description":"SmileAgile measures the morale of agile teams: each survey, one per sprint, asks the team how happy they are, from 0 (very unhappy) to 5 (very happy), with an optional comment; the votes are anonymous, the results always aggregated.\n\nIts REST API: the teams, their surveys and the votes, the departments, the users and the administration, as the\nweb app uses them.\n\n**Access:** sign in with `POST /api/users/auth`. The login token comes back in the `token` cookie; send it\nback as that cookie, or in the `Authorization` header: `Bearer eyJ0eXAiOiJKV1Qi...`. The personal access\ntokens and OAuth work on the MCP server (`/mcp`) only, for the AI assistants: see\n[the AI assistants, step by step](https://www.smileagile.io/views/guest/documentation/MCP-StepByStep).\n\n**Anonymity:** the results are aggregated, never who voted what.\n\n**Errors:** a JSON object with the status, f.e. `{\"error\": \"Team does not exist\"}`.\n\n**Questions:** [the contact page](https://www.smileagile.io/views/guest/contact).","termsOfService":"https://www.smileagile.io/views/guest/terms","contact":{"name":"SmileAgile","url":"https://www.smileagile.io","email":"support@smileagile.io"},"license":{"name":"Proprietary","url":"https://www.smileagile.io/views/guest/terms"},"version":"1.11.2"},"servers":[{"url":"https://www.smileagile.io"}],"paths":{"/api/locales":{"get":{"tags":["Administration"],"summary":"The server's languages","description":"The installed locales, and the one a language picks","operationId":"getLocales","parameters":[{"name":"locale","in":"query","description":"An `Accept-Language` value","schema":{"type":"string","example":"fr-FR"}}],"responses":{"200":{"description":"The locales","content":{"application/json":{"schema":{"properties":{"installed_locales":{"type":"array","items":{"type":"string"}},"requested_locale":{"type":["string","null"]},"used_locale":{"type":["string","null"]},"translation":{"description":"A word translated, to check","type":"string"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/admin/directory-reviewer/reset":{"post":{"tags":["Administration"],"summary":"Reset the directory reviewer's demo","description":"Its copy of the demo department back to the demo's, what the reviewer added gone, the account kept","operationId":"resetDirectoryReviewer","responses":{"200":{"description":"The reviewer and its copy","content":{"application/json":{"schema":{"properties":{"user_id":{"type":["integer","null"]},"email":{"type":"string"},"connected_on":{"$ref":"#/components/schemas/Timestamp"},"last_mcp_use":{"$ref":"#/components/schemas/Timestamp"},"teams":{"type":"integer"},"surveys":{"type":"integer"},"added_surveys":{"type":"integer"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/admin/oauth-clients":{"get":{"tags":["Administration"],"summary":"List the confidential OAuth clients","description":"The clients created by an administrator (f.e. Gemini Enterprise's), never their secret: their users connected, their last use","operationId":"listOAuthClients","responses":{"200":{"description":"The clients","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OAuthClient"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Administration"],"summary":"Create a confidential OAuth client","description":"Its client ID and secret, for the AI assistant's administrator: the secret in this response only","operationId":"createOAuthClient","requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["name","redirect_uris"],"properties":{"name":{"type":"string","example":"Gemini Enterprise, Acme","maxLength":100},"redirect_uris":{"type":"array","items":{"type":"string"},"example":["https://vertexaisearch.cloud.google.com/oauth-redirect"],"maxItems":10}},"type":"object"}}}},"responses":{"201":{"description":"The client, its secret included","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientSecret"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/admin/oauth-clients/{client_id}/secret":{"post":{"tags":["Administration"],"summary":"Rotate a confidential OAuth client's secret","description":"A new secret, in this response only; the previous one refused at once (to enter in the AI assistant), its users still connected","operationId":"rotateOAuthClientSecret","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The new secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientSecret"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/admin/oauth-clients/{client_id}":{"delete":{"tags":["Administration"],"summary":"Delete a confidential OAuth client","description":"Its users disconnected (their connections revoked); the AI assistant can no longer connect with it","operationId":"deleteOAuthClient","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/users/current/tokens":{"get":{"tags":["Profile"],"summary":"List your access tokens","description":"Your personal access tokens and your AI assistants' connections (OAuth), never their values","operationId":"listAccessTokens","responses":{"200":{"description":"Your tokens","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccessToken"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Profile"],"summary":"Create an access token","description":"For the MCP server (`/mcp`). Its value is in this response only. 10 active tokens at most","operationId":"createAccessToken","requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["name"],"properties":{"name":{"type":"string","example":"Claude Code","maxLength":100},"scope":{"type":"string","default":"read","enum":["read","write"]},"expires_in_days":{"type":"integer","default":90,"maximum":365,"minimum":1}},"type":"object"}}}},"responses":{"201":{"description":"The token, its value included","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewAccessToken"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"description":"Too many active tokens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/users/current/tokens/{id}/renew":{"post":{"tags":["Profile"],"summary":"Renew an access token","description":"A new token, the same name and access, the default expiration; its value in this response only. The old one revoked","operationId":"renewAccessToken","parameters":[{"name":"id","in":"path","description":"The token's ID","required":true,"schema":{"type":"integer"}}],"responses":{"201":{"description":"The new token, its value included","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewAccessToken"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"An AI assistant's connection (reconnect it from the assistant), a revoked token, or the limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/users/current/tokens/{id}":{"delete":{"tags":["Profile"],"summary":"Revoke an access token","operationId":"revokeAccessToken","parameters":[{"name":"id","in":"path","description":"The token's ID","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Revoked"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Unknown, revoked already, or not yours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health":{"get":{"tags":["Health"],"summary":"The service's health","operationId":"health","responses":{"200":{"description":"Running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"description":"The database unreachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}},"security":[]}},"/api/mcp/access-logs":{"get":{"tags":["Administration"],"summary":"The AI assistants' accesses","description":"The reads of comments and the changes made through the MCP server, the latest first","operationId":"listMcpAccessLogs","parameters":[{"name":"user_id","in":"query","schema":{"type":"integer","minimum":1}},{"name":"survey_uuid","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","description":"UTC, inclusive","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"UTC, inclusive","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":100,"minimum":1}}],"responses":{"200":{"description":"The entries","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"mcp_access_log_id":{"type":"integer"},"created_on":{"$ref":"#/components/schemas/Timestamp"},"tool":{"type":"string","example":"get_survey_comments"},"user":{"properties":{"user_id":{"type":"integer"},"name":{"type":"string"},"email":{"type":"string"}},"type":"object"},"token":{"properties":{"api_token_id":{"type":"integer"},"name":{"type":"string"},"token_prefix":{"type":"string"}},"type":"object"},"survey":{"properties":{"survey_uuid":{"type":"string"},"name":{"type":"string"},"team_id":{"type":"integer"},"team_name":{"type":"string"}},"type":["object","null"]},"team":{"properties":{"team_id":{"type":"integer"},"name":{"type":"string"}},"type":["object","null"]}},"type":"object"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/messages":{"get":{"tags":["Administration"],"summary":"List the messages","operationId":"listMessages","responses":{"200":{"description":"The messages","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Administration"],"summary":"Write a message","operationId":"createMessage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"responses":{"201":{"description":"The message created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"416":{"$ref":"#/components/responses/Range"},"422":{"description":"It exists already","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/messages/{id}":{"get":{"tags":["Administration"],"summary":"Get a message","operationId":"getMessage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Administration"],"summary":"Update a message","operationId":"updateMessage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"responses":{"200":{"description":"The message updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"416":{"$ref":"#/components/responses/Range"},"422":{"description":"Its ID or author changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Administration"],"summary":"Delete a message","operationId":"deleteMessage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/messages/{id}/send":{"post":{"tags":["Administration"],"summary":"Send a message","description":"By email, to the users with its roles","operationId":"sendMessage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageSent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"416":{"$ref":"#/components/responses/Range"}}}},"/api/messages/{id}/send/{user_id}":{"post":{"tags":["Administration"],"summary":"Send a message to one user","operationId":"sendMessageToUser","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageSent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"416":{"$ref":"#/components/responses/Range"}}}},"/api/organizations":{"get":{"tags":["Departments"],"summary":"List your departments","operationId":"listDepartments","responses":{"200":{"description":"Your departments","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Department"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Departments"],"summary":"Create a department","description":"With your teams; you become its owner","operationId":"createDepartment","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentInput"}}}},"responses":{"201":{"description":"The department created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Department"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"A team not yours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A department with this name exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"$ref":"#/components/responses/Range"}}}},"/api/organizations/{id}":{"get":{"tags":["Departments"],"summary":"Get a department","operationId":"getDepartment","parameters":[{"name":"id","in":"path","description":"The department's ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The department","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Department"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Departments"],"summary":"Update a department and its teams","description":"Its teams replaced by `teams`: yours, or attached already","operationId":"updateDepartment","parameters":[{"name":"id","in":"path","description":"The department's ID","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentInput"}}}},"responses":{"200":{"description":"The department updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Department"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"A department with this name exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"$ref":"#/components/responses/Range"}}},"delete":{"tags":["Departments"],"summary":"Delete a department","description":"Not in production (`403`)","operationId":"deleteDepartment","parameters":[{"name":"id","in":"path","description":"The department's ID","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/api/organizations/{id}/teams":{"get":{"tags":["Departments"],"summary":"List a department's teams","operationId":"listDepartmentTeams","parameters":[{"name":"id","in":"path","description":"The department's ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Its teams","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentTeam"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"tags":["Departments"],"summary":"Add one of your teams to a department","operationId":"addDepartmentTeam","parameters":[{"name":"id","in":"path","description":"The department's ID","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentTeam"}}}},"responses":{"201":{"description":"The team added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentTeam"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Not this department, or a team not yours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"In the department already","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"description":"An unknown team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/teams/{resource_id}/ownership":{"get":{"tags":["Ownership"],"summary":"List a team's owners","operationId":"listTeamOwners","parameters":[{"name":"resource_id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Its owners","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Ownership"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Ownership"],"summary":"Replace a team's owners","description":"All of them, each checked before any change","operationId":"setTeamOwners","parameters":[{"name":"resource_id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Ownership"}}}}},"responses":{"200":{"description":"Its owners","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Ownership"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"416":{"$ref":"#/components/responses/Range"}}},"post":{"tags":["Ownership"],"summary":"Add an owner to a team","description":"Yours (`\"user_id\": \"current\"`), or another user's when you own the team","operationId":"addTeamOwner","parameters":[{"name":"resource_id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["user_id","resource","team_id"],"properties":{"user_id":{"oneOf":[{"type":"integer"},{"type":"string","enum":["current"]}]},"resource":{"type":"string","enum":["teams"]},"team_id":{"description":"The path's","type":"integer"}},"type":"object"}}}},"responses":{"201":{"description":"The ownership created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ownership"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"An owner already, an unknown user, or not the path's team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"$ref":"#/components/responses/Range"}}}},"/api/teams/{resource_id}/ownership/{ownership_id}":{"get":{"tags":["Ownership"],"summary":"Get one of a team's owners","operationId":"getTeamOwner","parameters":[{"name":"resource_id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}},{"name":"ownership_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The ownership","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ownership"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Ownership"],"summary":"Remove an owner from a team","operationId":"removeTeamOwner","parameters":[{"name":"resource_id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}},{"name":"ownership_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Removed"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Ownership"],"summary":"Mark a team as your favorite, or not","description":"Your own ownership only: JSON Patch, `replace` on `/is_favorite`","operationId":"updateTeamOwner","parameters":[{"name":"resource_id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}},{"name":"ownership_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Patch"}},"example":[{"op":"replace","path":"/is_favorite","value":true}]}}},"responses":{"201":{"description":"The ownership updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ownership"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"501":{"$ref":"#/components/responses/NotImplemented"}}}},"/api/settings":{"get":{"tags":["Administration"],"summary":"List the settings","operationId":"listSettings","responses":{"200":{"description":"The settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Administration"],"summary":"Create a setting","operationId":"createSetting","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"responses":{"201":{"description":"The setting created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"416":{"$ref":"#/components/responses/Range"},"422":{"description":"It exists already","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/settings/{domain}":{"get":{"tags":["Administration"],"summary":"List a domain's settings","operationId":"listDomainSettings","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z_-]+$","example":"sprints"}}],"responses":{"200":{"description":"Its settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/settings/{domain}/{key}":{"get":{"tags":["Administration"],"summary":"Get a setting","operationId":"getSetting","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z_-]+$","example":"sprints"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z_-]+$","example":"num"}}],"responses":{"200":{"description":"The setting","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/settings/{id}":{"get":{"tags":["Administration"],"summary":"Get a setting by its ID","operationId":"getSettingById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The setting","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Administration"],"summary":"Update a setting","description":"Its ID, domain and key unchanged","operationId":"updateSetting","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"responses":{"200":{"description":"The setting updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"416":{"$ref":"#/components/responses/Range"},"422":{"description":"Its ID, domain or key changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Administration"],"summary":"Delete a setting","operationId":"deleteSetting","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/users/current/identities/{provider}":{"delete":{"tags":["Profile"],"summary":"Unlink a sign-in provider (Google)","description":"Refused when it is your last way to sign in","operationId":"unlinkIdentity","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","example":"google"}}],"responses":{"204":{"description":"Unlinked"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not linked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Your last way to sign in: set a password first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/teams/{team_id}/surveys":{"get":{"tags":["Surveys"],"summary":"List a team's surveys","description":"The latest first","operationId":"listSurveys","parameters":[{"$ref":"#/components/parameters/team_id"},{"name":"is_closed","in":"query","description":"The closed ones only (true), the open ones only (false)","schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"How many, the settings' number of sprints by default","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Its surveys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Survey"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"416":{"description":"The limit not positive","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Surveys"],"summary":"Create a survey","description":"Its voting link from its UUID. A daily limit applies","operationId":"createSurvey","parameters":[{"$ref":"#/components/parameters/team_id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["name"],"properties":{"name":{"type":"string","example":"Sprint 2026 WK48 Phoenix"},"is_closed":{"description":"A past sprint imported","type":"boolean"},"valid_from":{"type":"string","format":"date"},"valid_to":{"type":"string","format":"date"}},"type":"object"}}}},"responses":{"201":{"description":"The survey created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"A survey with this name exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"$ref":"#/components/responses/Range"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/teams/{team_id}/surveys/{survey_uuid}":{"delete":{"tags":["Surveys"],"summary":"Delete a survey without votes","operationId":"deleteSurvey","parameters":[{"$ref":"#/components/parameters/team_id"},{"$ref":"#/components/parameters/survey_uuid"}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"416":{"description":"The survey has votes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Surveys"],"summary":"Update a survey: close it, reopen it, rename it","description":"JSON Patch, `replace` only, on `/is_closed`, `/name` or `/valid_from`","operationId":"updateSurvey","parameters":[{"$ref":"#/components/parameters/team_id"},{"$ref":"#/components/parameters/survey_uuid"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Patch"}},"example":[{"op":"replace","path":"/is_closed","value":1}]}}},"responses":{"201":{"description":"The survey updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Not this team's survey","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"$ref":"#/components/responses/Range"},"501":{"$ref":"#/components/responses/NotImplemented"}}}},"/api/teams":{"get":{"tags":["Teams"],"summary":"List your teams","description":"The teams you own, and the ones shared with you","operationId":"listTeams","responses":{"200":{"description":"Your teams","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Team"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Teams"],"summary":"Create a team","description":"You become its owner. A new account owns a few teams until an administrator confirms it; a daily limit applies","operationId":"createTeam","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInput"}}}},"responses":{"201":{"description":"The team created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"description":"A team with this name exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"description":"Without a name, or too long","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/teams/{team_id}":{"get":{"tags":["Teams"],"summary":"Get a team","operationId":"getTeam","parameters":[{"$ref":"#/components/parameters/team_id"}],"responses":{"200":{"description":"The team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Teams"],"summary":"Update a team","operationId":"updateTeam","parameters":[{"$ref":"#/components/parameters/team_id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInput"}}}},"responses":{"200":{"description":"The team updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"A team with this name exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"description":"Without a name, or too long","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Teams"],"summary":"Delete a team","description":"Not in production (`403`)","operationId":"deleteTeam","parameters":[{"$ref":"#/components/parameters/team_id"}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/teams/{team_id}/export":{"get":{"tags":["Teams"],"summary":"Export a team","description":"The team, its last 52 surveys and their votes (a score and a comment each, never who voted)","operationId":"exportTeam","parameters":[{"$ref":"#/components/parameters/team_id"}],"responses":{"200":{"description":"The export","content":{"application/json":{"schema":{"properties":{"team":{"properties":{"team_id":{"type":"integer"},"name":{"type":"string"},"survey_pattern":{"type":"string"},"chart_filename":{"type":["string","null"]}},"type":"object"},"surveys":{"type":"array","items":{"properties":{"survey_id":{"type":"integer"},"name":{"type":"string"},"is_anonymous":{"type":"integer","enum":[0,1]},"is_closed":{"type":"integer","enum":[0,1]},"team_id":{"type":"integer"},"valid_from":{"type":["string","null"],"format":"date"},"valid_to":{"type":["string","null"],"format":"date"}},"type":"object"}},"votes":{"type":"array","items":{"properties":{"survey_id":{"type":"integer"},"happiness":{"type":"integer","maximum":5,"minimum":0},"comment":{"type":["string","null"]}},"type":"object"}}},"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/teams/{team_id}/picture":{"post":{"tags":["Teams"],"summary":"Upload a team's picture","description":"The vote page's sharing image: a JPEG or PNG, 1200×630 at least, 5 MB at most, never resized. Without a file, nothing changes (`204`)","operationId":"uploadTeamPicture","parameters":[{"$ref":"#/components/parameters/team_id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"properties":{"picture":{"type":"string","format":"binary"}},"type":"object"}}}},"responses":{"201":{"description":"The picture saved","content":{"application/json":{"schema":{"properties":{"picture_name":{"type":"string"},"url":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"may_be_cropped":{"description":"Not 1.91:1: the chats may crop it","type":"boolean"}},"type":"object"}}}},"204":{"description":"No file: nothing changed"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Not a JPEG or PNG of 1200×630 at least, 5 MB at most","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/teams/{id}/token":{"get":{"tags":["Teams"],"summary":"Get a team's public chart link","operationId":"getChartLink","parameters":[{"name":"id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Its chart link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartLink"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"tags":["Teams"],"summary":"Publish a team's chart link","description":"Anyone with the link sees its morale chart, without signing in","operationId":"createChartLink","parameters":[{"name":"id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}}],"responses":{"201":{"description":"The chart link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartLink"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Published already","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Teams"],"summary":"Revoke a team's chart link","operationId":"revokeChartLink","parameters":[{"name":"id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Revoked: the link no longer works"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/users/auth":{"post":{"tags":["Account"],"summary":"Sign in","description":"The login token in the `token` cookie (`Set-Cookie`): send it back as that cookie, or in the `Authorization` header (`Bearer`, then the token)","operationId":"signIn","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credentials"}}}},"responses":{"204":{"description":"Signed in","headers":{"Set-Cookie":{"description":"The `token` cookie: the login token","schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"description":"Wrong email or password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"description":"The email not validated, or the account not activated yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountWorkflow"}}}}},"security":[]},"delete":{"tags":["Account"],"summary":"Sign out","description":"The `token` cookie cleared","operationId":"signOut","responses":{"201":{"description":"Signed out"}},"security":[]}},"/api/users/email-validation":{"post":{"tags":["Account"],"summary":"Validate an account's email","description":"From the validation email's link","operationId":"validateEmail","requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["uuid","email","password"],"properties":{"uuid":{"$ref":"#/components/schemas/Uuid","description":"The link's"},"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"}},"type":"object"}}}},"responses":{"204":{"description":"Validated"},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"description":"Wrong credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"$ref":"#/components/responses/Range"}},"security":[]}},"/api/users/forgotten-password":{"post":{"tags":["Account"],"summary":"Forgotten password","description":"An email with a link to set a new password, when the account exists; the same answer otherwise","operationId":"forgottenPassword","requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["email"],"properties":{"email":{"type":"string","format":"email"}},"type":"object"}}}},"responses":{"204":{"description":"Done"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[]}},"/api/users/reset-password/{user_uuid}":{"post":{"tags":["Account"],"summary":"Set a new password","description":"From the forgotten password email's link","operationId":"resetPassword","parameters":[{"name":"user_uuid","in":"path","description":"The link's","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["email","password","password_confirm"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"},"password_confirm":{"type":"string","format":"password"}},"type":"object"}}}},"responses":{"201":{"description":"The password set"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"An unknown or expired link, another email, or the passwords different"}},"security":[]}},"/api/users":{"post":{"tags":["Account"],"summary":"Sign up","description":"An email to validate, then an administrator activates the account","operationId":"signUp","requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["email","password","firstname","lastname"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"},"firstname":{"type":"string"},"middlename":{"type":"string"},"lastname":{"type":"string"},"language":{"type":"string","enum":["en-US","fr-FR"]}},"type":"object"}}}},"responses":{"201":{"description":"The account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"description":"An account with this email exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"$ref":"#/components/responses/Range"}},"security":[]}},"/api/users/current":{"put":{"tags":["Profile"],"summary":"Update your profile","description":"Your email unchanged","operationId":"updateProfile","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"responses":{"200":{"description":"Your profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Sharing refused for your email's domain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"$ref":"#/components/responses/Range"}}},"delete":{"tags":["Profile"],"summary":"Delete your account","description":"Confirmed by its email; then signed out","operationId":"deleteAccount","requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["email"],"properties":{"email":{"description":"Your account's","type":"string","format":"email"}},"type":"object"}}}},"responses":{"204":{"description":"Deleted, signed out"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"description":"Not your account's email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Profile"],"summary":"Set your theme or language","description":"JSON Patch, `replace` on `/theme` (`dark`, `light`, empty: the device's) or `/language`. Signed in, kept in your profile; otherwise, in a cookie","operationId":"setPreferences","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Patch"}},"example":[{"op":"replace","path":"/theme","value":"dark"}]}}},"responses":{"204":{"description":"Set"},"400":{"description":"A theme or a language not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"$ref":"#/components/responses/NotImplemented"}},"security":[]}},"/api/users/{user_id}":{"put":{"tags":["Administration"],"summary":"Update a user","description":"Their profile, their email, their roles","operationId":"updateUser","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Profile"},{"properties":{"email":{"type":"string","format":"email"},"roles":{"type":"array","items":{"type":"string","enum":["GUEST","TEAMS.OWNER","TEAMS.ADMIN","ORGANIZATIONS.OWNER","ORGANIZATIONS.ADMIN","USERS.ADMIN","ADMIN"]}}},"type":"object"}]}}}},"responses":{"200":{"description":"The user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"416":{"$ref":"#/components/responses/Range"},"422":{"description":"An active account without a role","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Administration"],"summary":"Delete a user","description":"An inactive one only","operationId":"deleteUser","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"The account is active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Administration"],"summary":"Activate a user, or confirm their account","description":"JSON Patch, `replace` on `/is_active` (1 or 0) or `/confirmed` (an account active at once, confirmed: its limits lifted)","operationId":"activateUser","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Patch"}},"example":[{"op":"replace","path":"/is_active","value":1}]}}},"responses":{"201":{"description":"The user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"416":{"$ref":"#/components/responses/Range"},"422":{"description":"Your own account, its email not validated, or without a role","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"$ref":"#/components/responses/NotImplemented"}}}},"/surveys/{survey_uuid}/votes":{"post":{"tags":["Votes"],"summary":"Vote","description":"Anonymous, from the voting link: no sign-in. The survey open","operationId":"vote","parameters":[{"$ref":"#/components/parameters/survey_uuid"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoteInput"}}}},"responses":{"201":{"description":"The vote, its undo token to change it","headers":{"X-Total-Count":{"description":"The survey's votes so far","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vote"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The survey is closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"description":"A score not from 0 to 5, a comment over 500 characters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/surveys/{survey_uuid}/votes/{undo_token}":{"put":{"tags":["Votes"],"summary":"Change your vote","description":"With the undo token its vote gave, the survey open","operationId":"changeVote","parameters":[{"$ref":"#/components/parameters/survey_uuid"},{"name":"undo_token","in":"path","description":"The vote's undo token","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]{36}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoteInput"}}}},"responses":{"200":{"description":"The vote changed","headers":{"X-Total-Count":{"description":"The survey's votes so far","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vote"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The survey is closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"416":{"description":"An unknown undo token, a score not from 0 to 5, a comment over 500 characters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/surveys/{survey_uuid}/votes/count":{"get":{"tags":["Votes"],"summary":"Count a survey's votes","operationId":"countVotes","parameters":[{"$ref":"#/components/parameters/survey_uuid"}],"responses":{"200":{"description":"Its votes so far","content":{"application/json":{"schema":{"properties":{"count":{"type":"integer"}},"type":"object"}}}},"404":{"$ref":"#/components/responses/NotFound"}},"security":[]}},"/api/teams/{team_id}/surveys/{survey_uuid}/votes":{"delete":{"tags":["Votes"],"summary":"Delete an open survey's votes","description":"All of them: the team's owners only","operationId":"deleteVotes","parameters":[{"$ref":"#/components/parameters/team_id"},{"$ref":"#/components/parameters/survey_uuid"}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The survey is closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"required":["error"],"properties":{"error":{"type":"string","example":"Team does not exist"}},"type":"object"},"Uuid":{"description":"36 hexadecimal characters","type":"string","pattern":"^[0-9a-f]{36}$","example":"9f3c2a7e5b1d4c8a0e6f2b9d7a1c3e5f8b0d"},"Timestamp":{"description":"The database's: `YYYY-MM-DD HH:MM:SS`","type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$","example":"2026-11-30 18:53:00"},"Health":{"required":["app","database","environment"],"properties":{"app":{"properties":{"name":{"type":"string"},"version":{"type":"string","example":"1.11.2"},"message":{"type":"string"},"success":{"type":"boolean"}},"type":"object"},"database":{"properties":{"message":{"type":"string"},"version":{"description":"Its schema's version","type":"integer"},"success":{"type":"boolean"}},"type":"object"},"environment":{"properties":{"type":{"type":"string","enum":["DEV","UAT","PROD"]},"up_time":{"type":"string","example":"up 34 minutes"},"is_under_maintenance":{"description":"Null: the database unreadable","type":["boolean","null"]},"maintenance_reason":{"type":["string","null"],"enum":["origin_secret_missing","setting",null]}},"type":"object"}},"type":"object"},"Patch":{"description":"A JSON Patch operation (RFC 6902): `replace` only","required":["op","path","value"],"properties":{"op":{"type":"string","enum":["replace"]},"path":{"type":"string","example":"/is_closed"},"value":{"example":1}},"type":"object"},"OAuthClient":{"description":"A confidential OAuth client: never its secret","required":["client_id","name","redirect_uris","created_on","consents"],"properties":{"client_id":{"type":"string","pattern":"^[0-9a-f]{32}$"},"name":{"type":"string","example":"Gemini Enterprise, Acme"},"redirect_uris":{"type":"array","items":{"type":"string"}},"secret_created_on":{"$ref":"#/components/schemas/Timestamp"},"created_on":{"$ref":"#/components/schemas/Timestamp"},"created_by":{"description":"The administrator who created it","type":["string","null"]},"consents":{"description":"Its users connected","type":"integer"},"last_used_on":{"$ref":"#/components/schemas/Timestamp"}},"type":"object"},"OAuthClientSecret":{"description":"A confidential client's ID and secret: the secret shown this once","required":["client_id","client_secret"],"properties":{"client_id":{"type":"string","pattern":"^[0-9a-f]{32}$"},"client_secret":{"type":"string","pattern":"^[0-9a-f]{64}$"},"name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}}},"type":"object"},"AccessToken":{"description":"A personal access token, for the MCP server (`/mcp`): never its value, but at its creation","required":["api_token_id","name","token_prefix","scope","is_oauth","status"],"properties":{"api_token_id":{"type":"integer"},"name":{"type":"string","example":"Claude Code","maxLength":100},"token_prefix":{"description":"Its first characters, to recognize it","type":"string","example":"sa_1a2b"},"scope":{"type":"string","enum":["read","write"]},"is_oauth":{"description":"An AI assistant's connection (OAuth), not a token created here","type":"boolean"},"status":{"type":"string","enum":["active","revoked","expired"]},"expires_on":{"$ref":"#/components/schemas/Timestamp"},"last_used_on":{"$ref":"#/components/schemas/Timestamp"},"revoked_on":{"$ref":"#/components/schemas/Timestamp"},"created_on":{"$ref":"#/components/schemas/Timestamp"}},"type":"object"},"NewAccessToken":{"allOf":[{"$ref":"#/components/schemas/AccessToken"},{"required":["token"],"properties":{"token":{"description":"Its value: shown this once only","type":"string"}},"type":"object"}]},"Message":{"description":"An email to the users, by role","required":["roles","subject","body"],"properties":{"message_id":{"type":"integer"},"roles":{"description":"Its recipients: roles, comma separated","type":"string","example":"TEAMS.OWNER"},"subject":{"type":"string"},"body":{"type":"string"},"owner_id":{"description":"The administrator who wrote it","type":["integer","null"]}},"type":"object"},"MessageSent":{"required":["emails"],"properties":{"emails":{"description":"Its recipients","type":"array","items":{"type":"string"}}},"type":"object"},"Department":{"description":"A department (an organization): teams, their morale together","required":["organization_id","uuid","name"],"properties":{"organization_id":{"type":"integer"},"user_id":{"description":"Its owner","type":"integer"},"uuid":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string","example":"Engineering"},"day_shift":{"description":"Days taken off a survey's opening date to pick its week (3: opened Monday to Wednesday, the previous week)","type":"integer"},"aggregated_weeks":{"description":"Weeks aggregated in the department's chart","type":"integer","minimum":1},"chart_filename":{"type":["string","null"]}},"type":"object"},"DepartmentInput":{"required":["name"],"properties":{"name":{"type":"string","example":"Engineering"},"day_shift":{"type":"integer"},"aggregated_weeks":{"type":"integer","minimum":1},"chart_filename":{"type":"string"},"teams":{"description":"Its teams: yours, or attached already","type":"array","items":{"type":"integer"}}},"type":"object"},"DepartmentTeam":{"required":["organization_id","team_id"],"properties":{"organization_id":{"type":"integer"},"team_id":{"type":"integer"}},"type":"object"},"Ownership":{"description":"A user owning a team","required":["user_id","resource","team_id"],"properties":{"ownership_id":{"type":"integer"},"user_id":{"type":"integer"},"resource":{"type":"string","enum":["teams"]},"team_id":{"type":"integer"},"organization_id":{"type":["integer","null"]},"is_favorite":{"description":"Its owner's favorite","type":["integer","null"],"enum":[0,1,null]}},"type":"object"},"Setting":{"required":["domain","key","value"],"properties":{"setting_id":{"type":"integer"},"domain":{"type":"string","example":"sprints"},"key":{"type":"string","example":"num"},"value":{"description":"A text: a number or a boolean kept as its text","type":"string","example":"12"}},"type":"object"},"Survey":{"required":["survey_id","uuid","name","is_anonymous","is_closed","team_id"],"properties":{"survey_id":{"type":"integer","example":351},"uuid":{"$ref":"#/components/schemas/Uuid","description":"Its voting link: `/views/surveys/{uuid}/votes`"},"name":{"type":"string","example":"Sprint 2026 WK48 Phoenix"},"is_anonymous":{"type":"integer","enum":[0,1]},"is_closed":{"description":"Closed: no more votes; its results and comments readable","type":"integer","enum":[0,1]},"team_id":{"type":"integer"},"valid_from":{"type":["string","null"],"format":"date"},"valid_to":{"type":["string","null"],"format":"date"}},"type":"object"},"Team":{"required":["team_id","uuid","name","survey_pattern","survey_wording"],"properties":{"team_id":{"type":"integer","example":12},"uuid":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string","example":"Phoenix","maxLength":45},"survey_pattern":{"$ref":"#/components/schemas/SurveyPattern"},"chart_filename":{"description":"The chart's file name, when downloaded","type":["string","null"]},"picture_name":{"description":"Its sharing picture, set by its upload","type":["string","null"]},"survey_wording":{"$ref":"#/components/schemas/SurveyWording"}},"type":"object"},"TeamInput":{"required":["name"],"properties":{"name":{"type":"string","example":"Phoenix","maxLength":45},"survey_pattern":{"$ref":"#/components/schemas/SurveyPattern"},"chart_filename":{"type":"string"},"survey_wording":{"$ref":"#/components/schemas/SurveyWording"}},"type":"object"},"SurveyPattern":{"description":"The next survey's proposed name: `%%YEAR%%`, `%%WEEK%%`, `%%WEEK-1%%`, `%%LAST+1%%`, `%%LAST+2%%` and `%%TEAM%%` replaced","type":"string","example":"Sprint %%YEAR%% WK%%WEEK%% %%TEAM%%"},"SurveyWording":{"description":"The vote page's questions: 0, the last sprint; 1, the previous week; 2, this week; 3, since the last survey","type":"integer","enum":[0,1,2,3]},"ChartLink":{"description":"A team's public chart link: `/views/teams/{team_id}/chart/token/{jwt}`, readable without signing in","required":["token_id","resource","resource_id","jwt"],"properties":{"token_id":{"type":"integer"},"resource":{"type":"string","enum":["teams"]},"resource_id":{"description":"The team","type":"integer"},"jwt":{"description":"The link's token","type":"string"}},"type":"object"},"User":{"required":["user_id","email","firstname","lastname"],"properties":{"user_id":{"type":"integer"},"email":{"type":"string","format":"email"},"firstname":{"type":"string"},"middlename":{"type":"string"},"lastname":{"type":"string"},"language":{"type":["string","null"],"enum":["en-US","fr-FR",null]},"plan":{"type":"string","example":"beta"},"plan_expires":{"$ref":"#/components/schemas/Timestamp"},"is_email_validated":{"type":"integer","enum":[0,1]},"is_active":{"description":"Activated by an administrator","type":"integer","enum":[0,1]},"is_sharing_teams_with_peers":{"type":"integer","enum":[0,1]},"is_sharing_teams_across_org":{"type":"integer","enum":[0,1]}},"type":"object"},"Profile":{"required":["firstname","lastname"],"properties":{"firstname":{"type":"string"},"middlename":{"type":"string"},"lastname":{"type":"string"},"language":{"type":"string","enum":["en-US","fr-FR"]},"is_sharing_teams_with_peers":{"type":"boolean"},"is_sharing_teams_across_org":{"type":"boolean"}},"type":"object"},"Credentials":{"required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"}},"type":"object"},"AccountWorkflow":{"description":"The account not usable yet: its email to validate, or its activation awaited","properties":{"location":{"type":"string","example":"/views/users/account-workflow/9f3c2a7e5b1d4c8a0e6f2b9d7a1c3e5f8b0d"}},"type":"object"},"Vote":{"description":"A vote, anonymous: never who voted","required":["vote_id","survey_id","happiness","undo_token"],"properties":{"vote_id":{"type":"integer"},"survey_id":{"type":"integer"},"teammate_id":{"description":"Always null: anonymous","type":["integer","null"]},"happiness":{"description":"0, very unhappy, to 5, very happy","type":"integer","maximum":5,"minimum":0},"comment":{"type":["string","null"],"maxLength":500},"undo_token":{"description":"The voter's, to change their vote while the survey is open","type":"string","pattern":"^[a-z0-9]{36}$"}},"type":"object"},"VoteInput":{"required":["happiness"],"properties":{"happiness":{"type":"integer","example":4,"maximum":5,"minimum":0},"comment":{"description":"Optional; shown as text, never as HTML","type":"string","example":"Great teamwork on the release","maxLength":500}},"type":"object"}},"responses":{"BadRequest":{"description":"Invalid request: not a JSON body, a value refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Not signed in, or the login token expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Signed in, but not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Not found, or not yours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"In conflict with the current state (f.e. a name taken, a survey closed)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Range":{"description":"A value out of range, or missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unprocessable":{"description":"Well formed, but refused (f.e. a rule of the account)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"A limit reached (f.e. the day's teams or surveys)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotImplemented":{"description":"An operation or a path not supported (JSON Patch)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":{"team_id":{"name":"team_id","in":"path","description":"The team's ID","required":true,"schema":{"type":"integer"}},"survey_uuid":{"name":"survey_uuid","in":"path","description":"The survey's UUID, its voting link's","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}},"securitySchemes":{"cookieAuth":{"type":"apiKey","description":"The login token, set by `POST /api/users/auth`","name":"token","in":"cookie"},"bearerAuth":{"type":"http","description":"The login token (the `token` cookie's value) in the `Authorization` header","bearerFormat":"JWT","scheme":"bearer"}}},"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"tags":[{"name":"Teams","description":"The teams you own or share, their pictures and exports"},{"name":"Surveys","description":"A team's surveys, one per sprint"},{"name":"Votes","description":"A survey's anonymous votes, from its voting link (no sign-in)"},{"name":"Ownership","description":"A team's owners"},{"name":"Departments","description":"The departments (organizations) and their teams"},{"name":"Account","description":"Signing in and out, signing up, the password"},{"name":"Profile","description":"The signed-in user: their profile, their access tokens, their sign-in identities"},{"name":"Administration","description":"The users, the settings, the messages, the logs: the administrators only"},{"name":"Health","description":"The service's health"}]}