{"openapi":"3.0.0","servers":[{"url":"https://api.example.com/api/v1"}],"info":{"description":"Back-end API for 2Tonnes","version":"1.15.0","title":"2 Tonnes API","contact":{"email":"xavier@2tonnes.org"},"license":{"name":"License Apache","url":"https://github.com/2tons/back-end/blob/master/LICENSE"}},"tags":[{"name":"default"},{"name":"authentication","description":"Routes to use for authentication"},{"name":"coaches","description":"Basic routes to manage coaches"},{"name":"workshops","description":"Routes to manage workshops"},{"name":"workshop participants","description":"Routes to manage participants of a given workshop"},{"name":"workshop rounds","description":"Routes to manage the rounds of a given workshop"},{"name":"workshop participants actions","description":"Routes to manage saved actions of workshop's participants"},{"name":"models","description":"Routes to manage models"},{"name":"participants","description":"Routes to manage participants"},{"name":"individual choices","description":"Routes to manage individual choices"},{"name":"carbon form answers","description":"Routes to manage carbon form answers"},{"name":"organisations","description":"Routes to manage organisations"},{"name":"facilitator path","description":"Routes to manage users facilitator path"},{"name":"audiences","description":"Routes to manage audiences"},{"name":"trainings","description":"Routes to manage trainings"},{"name":"training participants","description":"Routes to manage training participants"}],"paths":{"/":{"get":{"tags":["default"],"operationId":"default","description":"To test if the mongo DB is alive\n","responses":{"200":{"description":"If successful ping to Mongo database","content":{"application/json":{"example":{"ok":1.0}}}}},"servers":[{"url":"https://api.example.com/api"}]}},"/ping":{"get":{"tags":["default"],"operationId":"ping","description":"To test if the server is alive\nUse the \"ping\" command from Mongo\nhttps://docs.mongodb.com/manual/reference/command/ping/\n","responses":{"200":{"description":"Default response","content":{"application/json":{"example":{"data":"pong"}}}}}}},"/ping_mongo":{"get":{"tags":["default"],"operationId":"pingMongo","description":"To test if the mongo DB is alive\n","responses":{"200":{"description":"If successful ping to Mongo database","content":{"application/json":{"example":{"ok":1.0}}}}},"servers":[{"url":"https://api.example.com/api"}]}},"/login":{"post":{"tags":["authentication"],"summary":"Generate and return access token","operationId":"login","description":"By providing email and password, return an access token that enables the access to protected routes.\n","requestBody":{"$ref":"#/components/requestBodies/LoginBody"},"responses":{"200":{"description":"Bearer token to use for protected routes","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","example":"your_access_token"}}}}}},"404":{"$ref":"#/components/responses/ErrorEmailNotFound"}}}},"/login_sso":{"post":{"tags":["authentication"],"summary":"Generate and return access token","operationId":"loginSso","description":"By providing an access token and a type of SSO, return an access token that enables the access to protected routes.\nThis routes should only be used by the 2tonnes permanents\n","requestBody":{"$ref":"#/components/requestBodies/LoginSsoBody"},"responses":{"200":{"description":"Bearer token to use for protected routes","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","example":"your_access_token"}}}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"404":{"$ref":"#/components/responses/ErrorEmailNotFound"}}}},"/forgotten_password":{"post":{"tags":["authentication"],"summary":"For user who has forgot their password","operationId":"forgottenPassword","description":"Given an email. Send a mail to the user with a link to reset his/her password.\n","requestBody":{"$ref":"#/components/requestBodies/ForgottenPasswordBody"},"responses":{"204":{"description":"Password successfully reseted"},"404":{"$ref":"#/components/responses/ErrorEmailNotFound"}}}},"/reset_password":{"post":{"tags":["authentication"],"security":[{"BearerAuth":[]}],"summary":"To reset the password of an user","operationId":"resetPassword","description":"Reset the password of an user.\nNeed to provide access_token through header\n","requestBody":{"$ref":"#/components/requestBodies/ResetPasswordBody"},"responses":{"204":{"description":"Password successfully updated"},"401":{"$ref":"#/components/responses/ErrorAuthorization"}}}},"/confirm_email":{"put":{"tags":["authentication"],"security":[{"BearerAuth":[]}],"summary":"To confirm the email of an user","operationId":"confirmEmail","description":"Route to use in order to confirm the email of an user.\nNeed to provide access_token through header\n\nWill update user with attribute \"emailConfirmedAt\"\n","responses":{"200":{"description":"Attribute \"emailConfirmedAt\" successfully updated","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/UserMe"}]}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/resend_confirm_email":{"post":{"tags":["authentication"],"summary":"To resend the mail used to confirm the email of an user","operationId":"resendConfirmEmailMail","description":"Route to use in order to resend the mail used to confirm the email of an user.\nNo need to provide access_token through header.\nNeed to provide an email linked to an existing user who's email isn't confirmed.\n","responses":{"204":{"description":"Email was resent"},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/logout":{"delete":{"tags":["authentication"],"security":[{"BearerAuth":[]}],"summary":"Logout user","operationId":"logout","description":"Revoke access token of the user.","responses":{"204":{"description":"User has successfully logout."},"401":{"$ref":"#/components/responses/ErrorAuthorization"}}}},"/users/me":{"get":{"tags":["authentication"],"summary":"Get info on currently authenticated user","operationId":"getUserMe","description":"Provide infos about the user based on the authentication token\n","responses":{"200":{"description":"Data of the currently authenticated user","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/UserMe"}]}}}},"404":{"$ref":"#/components/responses/ErrorEmailNotFound"}}}},"/users/me/licenseAcceptedAt":{"put":{"tags":["authentication"],"summary":"Update license agreement","operationId":"putUserMeLicenseAcceptedAt","description":"Update field licenseAcceptedAt of authenticated user to now()\n","responses":{"200":{"description":"Data of the currently authenticated user","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Coach"},{"type":"object","properties":{"licenseAcceptedAt":{"type":"string","format":"date-time","example":"2020-10-27T08:26:00.000+00:00"}}}]}}}},"404":{"$ref":"#/components/responses/ErrorEmailNotFound"}}}},"/coaches":{"get":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Get all coaches","operationId":"getAllCoaches","description":"Get the list of all coaches.\n\nPermissions - admin, coaches\n","responses":{"200":{"description":"List of coaches","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Coach"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}},"post":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Create a coach","operationId":"createCoach","description":"Create a coach. Will send an email to the coach with a random generated password.\n\nPermissions - admin\n","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Coach"},{"type":"object","properties":{"password":{"type":"string","example":"password"}}}]}}}},"responses":{"200":{"description":"Succesfully created a coach","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coach"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/coaches/{coachId}":{"get":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Get detail on a coach","operationId":"getCoach","description":"Get a coach given its id.\n\nPermissions - admin, coaches\n","parameters":[{"$ref":"#/components/parameters/coachParam"}],"responses":{"200":{"description":"Detail about a coach","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coach"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"patch":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Patch a coach","operationId":"patchCoach","description":"Patch a coach.\n\nIf trying to update the email into that already exists, will raise an error 400\n\nPermissions - admin\n","parameters":[{"$ref":"#/components/parameters/coachParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchCoach"}}}},"responses":{"200":{"description":"Succesfully updated coach","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coach"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"delete":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Delete coach","operationId":"deleteCoach","description":"Delete a coach given its id.\n\nPermission - admin or user himself\n","parameters":[{"$ref":"#/components/parameters/coachParam"}],"responses":{"204":{"description":"Coach sucessfully deleted"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/coaches/{coachId}/statistics":{"get":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Get statistics on a coach","operationId":"getCoachStatistics","description":"Get the statistics of a coach given its id.\n\nPermissions - user himself\n","parameters":[{"$ref":"#/components/parameters/coachParam"}],"responses":{"200":{"description":"Detail about a coach","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoachStatistics"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/coaches/{coachId}/organisations":{"get":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Get the organisations linked to a coach","operationId":"getCoachOrganisations","description":"Get the organisations of a coach given its id.\n\nPermissions - user himself or admin\n","parameters":[{"$ref":"#/components/parameters/coachParam"}],"responses":{"200":{"description":"List of organisations related to the coach","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CoachOrganisation"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/coaches/{coachId}/organisations/{organisationId}":{"delete":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Remove coach from organisation","operationId":"deleteCoachOrganisations","description":"Remove coach from organisation\n\nPermissions - user himself or admin\n","parameters":[{"$ref":"#/components/parameters/coachParam"},{"$ref":"#/components/parameters/organisationParam"}],"responses":{"204":{"description":"Successfully removed coach from organisation"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/coaches/{coachId}/demote":{"delete":{"tags":["coaches"],"security":[{"BearerAuth":[]}],"summary":"Demote a coach","operationId":"demoteCoach","description":"Remove the coach role from a coach\nWill remove coach from the organisation he belongs to and also remove its badges\nWill raise a 403 permission error if the coach has created one workshop\n\nPermissions - admin only\n","parameters":[{"$ref":"#/components/parameters/coachParam"}],"responses":{"204":{"description":"Successfully demoted the coach"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/coaches/{coachId}/facilitator_path":{"get":{"tags":["facilitator path"],"security":[{"BearerAuth":[]}],"summary":"Get a coach's facilitator path","operationId":"getCoachFacilitatorPath","description":"Get a coach's facilitator path\n\nPermissions - admin only or coach itself\n","parameters":[{"$ref":"#/components/parameters/coachParam"}],"responses":{"200":{"description":"Data of the coach's facilitator path","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilitatorPath"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/coaches/{coachId}/facilitator_path/{roleName}":{"post":{"tags":["facilitator path"],"security":[{"BearerAuth":[]}],"summary":"Add a role to an user's facilitator path","operationId":"addFacilitatorPathRoleToUser","description":"Add a role to an user's facilitator path\n\nPermissions - admin\n","parameters":[{"$ref":"#/components/parameters/coachParam"},{"$ref":"#/components/parameters/facilitatorPathRoleNameParam"}],"responses":{"200":{"description":"Data of the coach's facilitator path, without FacilitatorPathEvent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilitatorPath"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"delete":{"tags":["facilitator path"],"security":[{"BearerAuth":[]}],"summary":"Remove a role to an user's facilitator path","operationId":"removeFacilitatorPathRoleToUser","description":"Remove a role to an user's facilitator path\n\nPermissions - admin\n","parameters":[{"$ref":"#/components/parameters/coachParam"},{"$ref":"#/components/parameters/facilitatorPathRoleNameParam"}],"responses":{"200":{"description":"Data of the coach's facilitator path, without FacilitatorPathEvent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilitatorPath"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/coaches/{coachId}/facilitator_path/{roleName}/badges":{"patch":{"tags":["facilitator path"],"security":[{"BearerAuth":[]}],"summary":"Add or remove multiple badges to an user's facilitator path role","operationId":"addOrRemoveFacilitatorPathBadgeToUser","description":"Add or remove one or many badge to an user's facilitator path role\nWill ignore if we try to add a badge that an user already has\nWill ignore if we try remove a badge that an user doesn't have\n\nPermissions - admin\n","parameters":[{"$ref":"#/components/parameters/coachParam"},{"$ref":"#/components/parameters/facilitatorPathRoleNameParam"}],"requestBody":{"$ref":"#/components/requestBodies/AddOrRemoveFacilitatorPathBadgeBody"},"responses":{"200":{"description":"Data of the coach's facilitator path, without FacilitatorPathEvent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilitatorPath"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops":{"get":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"List workshops","operationId":"getAllWorkshops","description":"Get the list of workshop.\n\nPermissions - admin, coaches\n","parameters":[{"in":"query","name":"limit","schema":{"type":"integer"},"description":"Number of elements returned. (default 100)"},{"in":"query","name":"offset","schema":{"type":"integer"},"description":"Number of elements to skip (default 0)","example":"status,-model.actionCards,rounds.roundConfig"},{"in":"query","name":"sort_by","schema":{"type":"string"},"description":"Allows to sort the list. (default \"-startDate\")","example":"-city,+startDate"},{"in":"query","name":"coachId","schema":{"type":"string"},"description":"Filter workshops by coach (default ∅)"},{"in":"query","name":"isTest","schema":{"type":"string"},"description":"Filter workshops by isTest flag  (default ∅, expect 'true' or 'false')"}],"responses":{"200":{"description":"Return an array with the list of workshops","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Workshop"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}},"post":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Create a workshop","operationId":"createWorkshop","description":"Create a workshop.\nTitle, coachId and startAt are required.\n\nPermissions - admin\n","requestBody":{"$ref":"#/components/requestBodies/WorkshopBody"},"responses":{"200":{"description":"Succesfully created a workshop","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workshop"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/workshops/{workshopId}":{"get":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Get a workshop","operationId":"getWorkshop","description":"Get detail on a workshop.\n\nPermissions - admin, coaches, participants\n","parameters":[{"$ref":"#/components/parameters/workshopParam"},{"in":"query","name":"fields","schema":{"type":"string"},"description":"Fields to include or exclude in output.\n\nSeparate fields by a comma, prefix with \"-\" in order to exclude fields.\nIf field in both included / excluded list, it will be included\n\nWill raise 500 if field does not exist\n"}],"responses":{"200":{"description":"Return the details on a workshop","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopDetail"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"put":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Update a workshop","operationId":"updateWorkshop","description":"Update a workshop.\n\nPermissions - admin, coach\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopDetail"}}}},"responses":{"200":{"description":"Succesfully updated a workshop","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workshop"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}},"patch":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Patch a workshop","operationId":"patchWorkshop","description":"Update only some fields of a workshop.\nFields that can be updated : format, context, contextMore, note, description, isTest, city, name, startAt, coachId, organisationI, organisationUsageAgreedAt, status, tCO2ePopulation2050, dashboardActivated\n\nPermissions - admin, coach\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchWorkshop"}}}},"responses":{"200":{"description":"Succesfully patched a workshop","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workshop"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}},"delete":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Delete a workshop","operationId":"deleteWorkshop","description":"Delete a workshop given its id.\n\nPermissions - admin, coach\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"responses":{"204":{"description":"Workshop sucessfully deleted"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/summary":{"get":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Get the basic data of a workshop","operationId":"getWorkshopSummary","description":"Get the basic data of a workshop.\n\nPermissions - participant\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"responses":{"200":{"description":"Return the basic data of a workshop","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Workshop"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/workshops/{workshopId}/reset":{"delete":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Reset a workshop","operationId":"resetWorkshop","description":"Reset a workshop given its id. Will delete all its rounds and the individual choices inputted\nby participants.\n\nPermissions - admin, coach\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"responses":{"204":{"description":"Workshop sucessfully reseted"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/activate_dashboard":{"post":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Activate dashboard of a workshop","operationId":"workshopActivateDashboard","description":"Activate the dashboard feature for a given workshop\n\nPermissions - admin, coach\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"responses":{"204":{"description":"Dashboard successfully updated"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/statistics":{"get":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Get statistics on all workshops","operationId":"getWorkshopStatistics","description":"Get the statistics of all workshops.\n\nPermissions - admin\n","responses":{"200":{"description":"Workshops statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationStatistics"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/workshops/{workshopId}/registered_users":{"get":{"tags":["workshops"],"security":[{"BearerAuth":[]}],"summary":"Get workshop registered users","operationId":"getWorkshopRegisteredUsers","description":"Get workshop registered users based on registrationUrl\nAvailable source : Eventbrite\n\nPermissions :\n  admin\n  coach of the workshop only if it's a personnal organisation\n  coach of the same organisations\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"responses":{"200":{"description":"Workshops statistics","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RegisteredUser"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/workshops/{workshopId}/rounds":{"get":{"tags":["workshop rounds"],"security":[{"BearerAuth":[]}],"summary":"List the rounds for a workshop","operationId":"getWorkshopRounds","description":"Get the list of rounds for a workshop\n\nPermissions - admin, coaches, participants\n","parameters":[{"$ref":"#/components/parameters/workshopParam"},{"in":"query","name":"fields","schema":{"type":"string","example":"year,status,roundConfig.actionCardType"},"description":"To narrow down the returned fields"},{"in":"query","name":"years","schema":{"type":"string"},"description":"To filter on specific year. Multiple years can be provided as long as it is splitted by commas\n","example":"2022,2025"},{"in":"query","name":"updated_after","schema":{"type":"string"},"description":"Filter on rounds updated after a certain timestamp. Expect an isoformat timestamp","example":"2022-02-20T18:50:00.000000+00:00\n"}],"responses":{"200":{"description":"Succesfully get workshop rounds","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRound"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"post":{"tags":["workshop rounds"],"security":[{"BearerAuth":[]}],"summary":"Create a workshop round","operationId":"createWorkshopRound","description":"Create a round for a workshop\n\nPermissions - admin, coaches\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"requestBody":{"$ref":"#/components/requestBodies/WorkshopRoundBody"},"responses":{"200":{"description":"Succesfully created workshop round","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopRound"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/rounds/{roundYear}":{"patch":{"tags":["workshop rounds"],"security":[{"BearerAuth":[]}],"summary":"Update a workshop round","operationId":"patchWorkshopRound","description":"Update a workshop round\nPermissions - admin, coaches\n\nNB: except for roundConfig and socialVariables, attributes are overwritten at root-level.\n","parameters":[{"$ref":"#/components/parameters/workshopParam"},{"$ref":"#/components/parameters/workshopRoundParam"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopRound"}}}},"responses":{"200":{"description":"Succesfully update the workshop round","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRound"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"delete":{"tags":["workshop rounds"],"security":[{"BearerAuth":[]}],"summary":"Delete a workshop round","operationId":"deleteWorkshopRound","description":"Delete a round for a workshop\n\nPermissions - admin, coaches\n","parameters":[{"$ref":"#/components/parameters/workshopParam"},{"$ref":"#/components/parameters/workshopRoundParam"}],"responses":{"204":{"description":"Succesfully created workshop round"},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/personas":{"post":{"tags":["workshop participants"],"security":[{"BearerAuth":[]}],"summary":"Add persona for a workshop","operationId":"createWorkshopPersonas","description":"Add a persona for a workshop\n\nPermissions - admin, coaches\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"requestBody":{"description":"Succesfully created participants","content":{"application/json":{"schema":{"type":"object","properties":{"personaId":{"type":"string"},"personaFirstName":{"type":"string"},"personaLastName":{"type":"string"}}}}}},"responses":{"200":{"description":"Succesfully created participants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopParticipant"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/personas_access_token":{"get":{"tags":["workshop participants"],"security":[{"BearerAuth":[]}],"summary":"Generate a persona access token","operationId":"createWorkshopPersonaAccessToken","description":"Generate a persona access token\n\nPermissions - admin, coaches\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"responses":{"200":{"description":"Succesfully created token","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","example":"token"}}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/participants/{workshopParticipantId}":{"patch":{"tags":["workshop participants"],"security":[{"BearerAuth":[]}],"summary":"Patch participant of a workshop","operationId":"patchWorkshopParticipant","description":"Patch participant of a workshop. Only updatable fields  ['carbonFormAnswersId'].\n\nIf an empty carbonFormAnswersId value is set, the carbonFormAnswersId is disassociated from the participant and the participant status is set to \"created\"\n\nIf a valid carbonFormAnswersId value is set, it is associated to th participant and the participant status is set to \"data_to_check\"\n\nPermissions - admin, coaches\n","parameters":[{"$ref":"#/components/parameters/workshopParam"},{"$ref":"#/components/parameters/workshopParticipantParam"}],"responses":{"200":{"description":"Succesfully patch participant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopParticipant"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"delete":{"tags":["workshop participants"],"security":[{"BearerAuth":[]}],"summary":"Delete participant of a workshop","operationId":"deleteWorkshopParticipant","description":"Delete participant of a workshop\n\nPermissions - admin, coaches\n","parameters":[{"$ref":"#/components/parameters/workshopParam"},{"$ref":"#/components/parameters/workshopParticipantParam"}],"responses":{"204":{"description":"Succesfully deleted participant"},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/validate_participants":{"post":{"tags":["workshop participants"],"security":[{"BearerAuth":[]}],"summary":"Set participant status to ready to workshop participants","operationId":"validateWorkshopParticipants","description":"Allows to set the status of participant to ready.\nIf there is one issue with a participant, the update will fail and\nno participant will get his/her status updated\n\nPermissions - admin, coaches\n","parameters":[{"$ref":"#/components/parameters/workshopParam"}],"requestBody":{"description":"Require a list of participantId\n","content":{"application/json":{"schema":{"type":"object","properties":{"workshopParticipantIds":{"type":"array","items":{"type":"string"},"example":["participantId1","participantId2"]}}}}}},"responses":{"204":{"description":"Succesfully updated participants"},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/participant_actions/{workshopParticipantId}":{"post":{"tags":["workshop participants actions"],"security":[{"BearerAuth":[]}],"summary":"Save participant post-workshop actions","operationId":"postWorkshopParticipantActions","description":"Save post-workshop actions of a participant\n\nPermissions - admin, coaches, participant\n","parameters":[{"$ref":"#/components/parameters/workshopParam"},{"$ref":"#/components/parameters/workshopParticipantParam"}],"requestBody":{"description":"Require a list of actionCardIds\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopParticipantActions"}}}},"responses":{"200":{"description":"Succesfully save participant actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopParticipantActions"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"get":{"tags":["workshop participants actions"],"security":[{"BearerAuth":[]}],"summary":"Get participant post-workshop actions","operationId":"getWorkshopParticipantActions","description":"Get post-workshop actions of a participant\n\nPermissions - admin, coaches, participant\n","parameters":[{"$ref":"#/components/parameters/workshopParam"},{"$ref":"#/components/parameters/workshopParticipantParam"}],"responses":{"200":{"description":"Succesfully save participant actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopParticipantActions"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/models/{modelId}":{"get":{"tags":["models"],"security":[{"BearerAuth":[]}],"summary":"Get a model","operationId":"getModel","description":"Get a model\n\nPermissions - admin, coaches, participants\n","parameters":[{"$ref":"#/components/parameters/modelParam"}],"responses":{"200":{"description":"Return the info of a model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDetail"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/models/":{"get":{"tags":["models"],"security":[{"BearerAuth":[]}],"summary":"Get models","operationId":"getModels","description":"Get the list of available models\nFor authenticated coach, restrict to only allowed models\n\nPermissions - admin, coaches, participants\n","parameters":[{"in":"query","name":"last_n_versions","schema":{"type":"integer"},"description":"Control how many versions (X.Y) is returned for each model key. (default 1)"}],"responses":{"200":{"description":"Return a list of models","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/models/keys":{"get":{"tags":["models"],"security":[{"BearerAuth":[]}],"summary":"Get models keys","operationId":"getModelKeys","description":"Get the list of all distinct models keys\n\nPermissions - admin\n","responses":{"200":{"description":"Return a list of string, corresponding to the distinct models keys","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"example":["france","world"]}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/{roundYear}/individualChoices":{"get":{"tags":["individual choices"],"summary":"Get individual choices","operationId":"getIndividualChoices","description":"Get the individual actions chosen by the participants for a given round\n\nPermissions - admin / coach\n","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/workshopParam"},{"$ref":"#/components/parameters/workshopRoundParam"}],"responses":{"200":{"description":"Successfully saved data","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IndividualChoice"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/workshops/{workshopId}/{roundYear}/individualChoices/{workshopParticipantId}":{"put":{"tags":["individual choices"],"summary":"Update individual choices","operationId":"putIndividualChoices","description":"Get the individual actions chosen by the participants for a given round\n\nPermissions - admin / coach\n","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndividualChoice"}}}},"parameters":[{"$ref":"#/components/parameters/workshopParam"},{"$ref":"#/components/parameters/workshopRoundParam"},{"$ref":"#/components/parameters/workshopParticipantParam"}],"responses":{"200":{"description":"Successfully saved data","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IndividualChoice"},{"type":"object","properties":{"workshopId":{"type":"string","example":"workshopId1","readOnly":true},"roundId":{"type":"number","example":2023,"readOnly":true}}}]}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/participants":{"get":{"tags":["participants"],"security":[{"BearerAuth":[]}],"summary":"List participants","operationId":"getParticipants","description":"Get the list of participants.\n\nPermissions - admin\n","parameters":[{"in":"query","name":"limit","schema":{"type":"integer"},"description":"Number of elements returned. (default 100)"},{"in":"query","name":"offset","schema":{"type":"integer"},"description":"Number of elements to skip (default 0)","example":0},{"in":"query","name":"sort_by","schema":{"type":"string"},"description":"Allows to sort the list. (default \"firstName\")","example":"-lastName"},{"in":"query","name":"email","schema":{"type":"string"},"description":"Filter participants by email (default ∅). Filter on multiple emails by separating them by a comma","example":"email1@test.com,email2@test.com"}],"responses":{"200":{"description":"Return an array with the list of participants","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}},"post":{"tags":["participants"],"summary":"Create a participant account","operationId":"createParticipant","description":"Create a participant account\n","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Participant"},{"type":"object","properties":{"password":{"type":"string","example":"password"}}}]}}}},"responses":{"200":{"description":"Succesfully created the participant account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/participants/search":{"get":{"tags":["participants"],"security":[{"BearerAuth":[]}],"summary":"Search participants","operationId":"searchParticipants","description":"Search participants based on a string query\nUse a Mongo text index applied on fields firstName, lastName and email\n(with respectively weight 1,1,2)\n\nPermissions - admin\n","parameters":[{"in":"query","name":"query","schema":{"type":"string"},"description":"String value to use a for the search. (Mandatory)"},{"in":"query","name":"limit","schema":{"type":"integer"},"description":"Number of elements returned. (default 100)"},{"in":"query","name":"offset","schema":{"type":"integer"},"description":"Number of elements to skip (default 0)","example":0},{"in":"query","name":"email","schema":{"type":"string"},"description":"Filter participants by email (default ∅). Filter on multiple emails by separating them by a comma","example":"email1@test.com,email2@test.com"},{"in":"query","name":"fields","schema":{"type":"string"},"description":"To limit which fields are outputted by the route (fields have to be separated by commas)","example":"id,firstName,lastName"}],"responses":{"200":{"description":"Return an array with the list of participants","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/participants/{participantId}":{"get":{"tags":["participants"],"security":[{"BearerAuth":[]}],"summary":"Get detail on a participant","operationId":"getParticipant","description":"Get a participant given its id.\n\nPermissions - admin or participant himself\n","parameters":[{"$ref":"#/components/parameters/participantParam"}],"responses":{"200":{"description":"Detail about a participant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"delete":{"tags":["participants"],"summary":"Delete a participant","operationId":"deleteParticipant","description":"Delete a participant (by anomizing it)\n\nPermission - admin or user himself\n","parameters":[{"$ref":"#/components/parameters/participantParam"}],"responses":{"204":{"description":"Successfully deleted participant"},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"patch":{"tags":["participants"],"summary":"Patch a participant","operationId":"patchParticipant","description":"Patch a participant\n\nPermission - admin or user himself\n","parameters":[{"$ref":"#/components/parameters/participantParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"responses":{"200":{"description":"Succesfully updated the participant account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Participant"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/participants/{participantId}/carbon_form_answers":{"get":{"tags":["participants"],"summary":"Get the carbon form answers of a participant","operationId":"getParticipantCarbonFormAnswers","description":"Return the list of carbon form answers of the participants\nCurrently return a list with an unique element, which is the last\ncreated carbon form answers\n\nPermission - admin or user himself\n","parameters":[{"$ref":"#/components/parameters/participantParam"}],"responses":{"200":{"description":"Successfully retrieved participant's carbon form answers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CarbonFormAnswers"}}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"post":{"tags":["participants"],"summary":"Create a participant's carbon form answers","operationId":"postParticipantCarbonFormAnswers","description":"Create a carbon form answers for a participant\n\nPermission - user himself\n","parameters":[{"$ref":"#/components/parameters/participantParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarbonFormAnswers"}}}},"responses":{"200":{"description":"Successfully created participant's carbon form answers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarbonFormAnswers"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/participants/{participantId}/register_workshop":{"post":{"tags":["participants"],"summary":"Participant's workshop registration","operationId":"participantWorkshopRegistration","description":"Allow a participant to register to a workshop\nUse parameter \"forceUpdate\" to update the carbonFormAnswersId of an\nalready registered participant\n\nOtherwise, will raise an error if trying to register an already registered\nparticipant\n\nPermission - user himself\n","parameters":[{"$ref":"#/components/parameters/participantParam"},{"in":"query","name":"forceUpdate","schema":{"type":"string"},"description":"true or false. Will update workshop participants instead of raising an error\nif participant already exists\n"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workshopId":{"type":"string"},"carbonFormAnswersId":{"type":"string"}}}}}},"responses":{"200":{"description":"Successfully register participant to workshop","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopParticipant"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/participants/{participantId}/workshops":{"get":{"tags":["participants"],"summary":"Get Participant's workshops","operationId":"getParticipantWorkshops","description":"Get the list of workshops in which a participant is registered\n\nPermission - admin or user himself","parameters":[{"$ref":"#/components/parameters/participantParam"}],"responses":{"200":{"description":"Successfully register participant to workshop","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopParticipant"}}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/carbon_form_answers/{carbonFormAnswersId}":{"get":{"tags":["carbon form answers"],"summary":"Get carbon form answers","operationId":"getCarbonFormAnswers","description":"Update a carbon form answers\n","parameters":[{"$ref":"#/components/parameters/carbonFormAnswersParam"}],"responses":{"200":{"description":"Successfully saved data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarbonFormAnswers"}}}},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"put":{"tags":["carbon form answers"],"summary":"Update carbon form answers","operationId":"putCarbonFormAnswers","description":"Update a carbon form answers\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarbonFormAnswers"}}}},"parameters":[{"$ref":"#/components/parameters/carbonFormAnswersParam"}],"responses":{"200":{"description":"Successfully saved data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarbonFormAnswers"}}}},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/organisations":{"get":{"tags":["organisations"],"security":[{"BearerAuth":["test"]}],"summary":"Get organisations","operationId":"getOrganisations","description":"Get a list of organizations\nParameter userId is mandatory for non-admin users\n","parameters":[{"in":"query","name":"limit","schema":{"type":"integer"},"description":"Number of elements returned. (default 100)"},{"in":"query","name":"offset","schema":{"type":"integer"},"description":"Number of elements to skip (default 0)"},{"in":"query","name":"sort_by","schema":{"type":"string"},"description":"Allows to sort the list. (default \"name\")","example":"-name,createdAt"},{"in":"query","name":"userId","schema":{"type":"string"},"description":"Filter organisations where the user is member (default ∅)"}],"responses":{"200":{"description":"Return a list of organisations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organisation"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}},"post":{"tags":["organisations"],"summary":"create an organisation","operationId":"postOrganisation","description":"Create an organisation\n\nPermission - super admin only\n","requestBody":{"description":"Data of the organisation to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationDetails"}}}},"responses":{"200":{"description":"Succesfully created an organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationDetails"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/organisations/{organisationId}":{"get":{"tags":["organisations"],"security":[{"BearerAuth":[]}],"summary":"Get an organisation","operationId":"getOrganisation","description":"Get the data of an organisation\n","parameters":[{"$ref":"#/components/parameters/organisationParam"}],"responses":{"200":{"description":"Return the data of an organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationDetails"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"patch":{"tags":["organisations"],"summary":"patch an organisation","operationId":"patchOrganisation","description":"Update the data of an organisation\n\nPermission - organisation admin or super admin\n","parameters":[{"$ref":"#/components/parameters/organisationParam"}],"requestBody":{"description":"Data to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationDetails"}}}},"responses":{"200":{"description":"Succesfully updated organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationDetails"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}},"delete":{"tags":["organisations"],"summary":"delete an organisation","operationId":"deleteOrganisation","description":"Delete an organisation\n\nPermission - super admin\n","parameters":[{"$ref":"#/components/parameters/organisationParam"}],"responses":{"204":{"description":"Succesfully deleted the organisation"},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}},"/organisations/{organisationId}/members":{"get":{"tags":["organisations"],"security":[{"BearerAuth":[]}],"summary":"Get organisation members","operationId":"getOrganisationMembers","description":"Get a list of organisation members\n\nPermissions - super admin, organisation members\n","parameters":[{"$ref":"#/components/parameters/organisationParam"}],"responses":{"200":{"description":"Return a list of organisation members","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganisationMember"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}},"post":{"tags":["organisations"],"summary":"create an organisation member","operationId":"postOrganisationMember","description":"Create an organisation member\nEmail or userId is required in order to add a coach to an organisation\nIf both is provided, will ignore email\n\nPermission - super admin or organisation admin\n","parameters":[{"$ref":"#/components/parameters/organisationParam"}],"requestBody":{"description":"Data of the organisation to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationMember"}}}},"responses":{"200":{"description":"Succesfully created an organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationMember"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/organisations/{organisationId}/members/{userId}":{"delete":{"tags":["organisations"],"security":[{"BearerAuth":[]}],"summary":"Remove an organisation member","operationId":"deleteOrganisationMember","description":"Delete an organisation members\n\nPermissions - super admin, organisation admin, or user himself\n","parameters":[{"$ref":"#/components/parameters/organisationParam"},{"$ref":"#/components/parameters/userParam"}],"responses":{"204":{"description":"Successfully remove the organisation member"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}},"put":{"tags":["organisations"],"summary":"update an organisation member","operationId":"putOrganisationMember","description":"Create an organisation member\n\nPermission - super admin or organisation admin\n","parameters":[{"$ref":"#/components/parameters/organisationParam"},{"$ref":"#/components/parameters/userParam"}],"requestBody":{"description":"Data of the organisation to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationMember"}}}},"responses":{"200":{"description":"Succesfully created an organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationMember"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/organisation/{organisationId}/statistics":{"get":{"tags":["organisations"],"security":[{"BearerAuth":[]}],"summary":"Get statistics on an organisation","operationId":"getOrganisationStatistics","description":"Get the statistics of an organisation given its id.\n\nPermissions - coach\n","parameters":[{"$ref":"#/components/parameters/organisationParam"}],"responses":{"200":{"description":"Organisation statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationStatistics"}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/trainings":{"post":{"tags":["trainings"],"security":[{"BearerAuth":[]}],"summary":"Create a training","operationId":"createTraining","description":"Create a training\n\nPermissions - admin, trainer\n","requestBody":{"description":"Data of the training to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Training"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Training"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/trainings/{trainingId}":{"patch":{"tags":["trainings"],"security":[{"BearerAuth":[]}],"summary":"Update a training","operationId":"patchTraining","description":"Update a training\n\nPermissions - admin, trainer\n","parameters":[{"$ref":"#/components/parameters/trainingParam"}],"requestBody":{"description":"Data of the training to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Training"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Training"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/trainings/{trainingId}/participants":{"post":{"tags":["training participants"],"security":[{"BearerAuth":[]}],"summary":"Manually add a training participant","operationId":"addTrainingParticipant","description":"Manually add a participant to a training\n\nPermissions - admin, trainer\n","parameters":[{"$ref":"#/components/parameters/trainingParam"}],"requestBody":{"description":"Data of the participants to import","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingParticipantProfile"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingParticipant"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/trainings/{trainingId}/synchronize_participants":{"patch":{"tags":["training participants"],"security":[{"BearerAuth":[]}],"summary":"Synchronize training participants with the users in the db","operationId":"synchronizeParticipants","description":"Synchronize training participants with the users in the db\nIf a user is found corresponding to a participant profile, we remove his profile and save the userId\n\nPermissions - admin, trainer\n","parameters":[{"$ref":"#/components/parameters/trainingParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingParticipant"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/trainings/{trainingId}/synchronize_participants_with_external_url":{"post":{"tags":["training participants"],"security":[{"BearerAuth":[]}],"summary":"Retrieve participants from external url (ie. eventbrite...) and synchronize training participants with the users in the db","operationId":"synchronizeParticipantsWithExternalUrl","description":"Retrieve participants from external url (ie. eventbrite...) and synchronize training participants with the users in the db\n\nPermissions - admin, trainer\n","parameters":[{"$ref":"#/components/parameters/trainingParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingParticipant"}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/trainings/{trainingId}/participants/{trainingParticipantId}":{"delete":{"tags":["training participants"],"security":[{"BearerAuth":[]}],"summary":"Manually remove a training participant","operationId":"removeTrainingParticipant","description":"Manually remove a participant to a training\nOnly possible if training is still in preparation, and if the participant\nhas been added by a manual import\n\nPermissions - admin, trainer\n","parameters":[{"$ref":"#/components/parameters/trainingParam"},{"$ref":"#/components/parameters/trainingParticipantParam"}],"responses":{"204":{"description":"Successfully deleted"},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/trainings/{trainingId}/participants/bulk_import":{"post":{"tags":["training participants"],"security":[{"BearerAuth":[]}],"summary":"Bulk import training participants","operationId":"bulkImportTrainingParticipants","description":"Add multiple participants at once\n\nPermissions - admin, trainer\n","parameters":[{"$ref":"#/components/parameters/trainingParam"}],"requestBody":{"description":"Data of the participants to import","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TrainingParticipantProfile"}}}}},"responses":{"207":{"description":"Multi-status response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"status":{"type":"integer"},"email":{"type":"string"},"data":{"oneOf":[{"$ref":"#/components/schemas/TrainingParticipant"},{"$ref":"#/components/schemas/Error"}]}}}}}}},"400":{"$ref":"#/components/responses/ErrorInvalidData"},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"}}}},"/audiences":{"get":{"tags":["audiences"],"security":[{"BearerAuth":[]}],"summary":"Get all audiences","operationId":"listAudiences","description":"Get the list of all audiences.\nIf parameter 'trainerId' is provided, return the list of audiences allowed\nfor the given trainer\n\nPermissions - admin\n","parameters":[{"in":"query","name":"trainerId","schema":{"type":"string"},"description":"To filter the audiences allowed for the given trainer"}],"responses":{"200":{"description":"List of audiences","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Audience"}}}}},"401":{"$ref":"#/components/responses/ErrorAuthorization"},"403":{"$ref":"#/components/responses/ErrorPermissionDenied"},"404":{"$ref":"#/components/responses/ErrorEntityNotFound"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"coachParam":{"in":"path","name":"coachId","schema":{"type":"string"},"required":true,"description":"ID of the coach"},"workshopParam":{"in":"path","name":"workshopId","schema":{"type":"string"},"required":true,"description":"ID of the workshop"},"workshopRoundParam":{"in":"path","name":"roundYear","schema":{"type":"integer"},"required":true,"description":"Round of the workshop"},"workshopParticipantParam":{"in":"path","name":"workshopParticipantId","schema":{"type":"string"},"required":true,"description":"ID of the workshop participant"},"participantParam":{"in":"path","name":"participantId","schema":{"type":"string"},"required":true,"description":"ID of the participant"},"userParam":{"in":"path","name":"userId","schema":{"type":"string"},"required":true,"description":"ID of the user"},"modelParam":{"in":"path","name":"modelId","schema":{"type":"string"},"required":true,"description":"ID of the model"},"accessTokenParam":{"in":"query","name":"access_token","schema":{"type":"string"},"required":true,"description":"An access token"},"carbonFormAnswersParam":{"in":"path","name":"carbonFormAnswersId","schema":{"type":"string"},"required":true,"description":"The ID of a carbon form answers"},"organisationParam":{"in":"path","name":"organisationId","schema":{"type":"string"},"required":true,"description":"The ID of an organisation"},"facilitatorPathRoleNameParam":{"in":"path","name":"roleName","schema":{"type":"string","enum":["facilitator","trainer","instructor"]},"required":true,"description":"Name of the facilitator path role"},"trainingParam":{"in":"path","name":"trainingId","schema":{"type":"string"},"required":true,"description":"ID of the training"},"trainingParticipantParam":{"in":"path","name":"trainingParticipantId","schema":{"type":"string"},"required":true,"description":"ID of the training participant"}},"responses":{"ErrorEmailNotFound":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"msg":"Login Error: Email not found"}}}},"ErrorInvalidPassword":{"description":"User found but wrong password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"msg":"Login Error: Incorrect password"}}}},"ErrorAuthorization":{"description":"If problem with authorization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"msg":"Authorization Error: Missing access token. You must login first."}}}},"ErrorPermissionDenied":{"description":"If user does not have enough access permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"msg":"Authorization Error: Permission Denied."}}}},"ErrorInvalidData":{"description":"If provided data is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ErrorEntityNotFound":{"description":"If provided id does not exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"msg":"Bad Request Error: Entity not found."}}}}},"requestBodies":{"LoginBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","example":"example@test.com"},"password":{"type":"string","example":"mysupersecretpassword"}}}}}},"LoginSsoBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accessToken","ssoType"],"properties":{"accessToken":{"type":"string"},"ssoType":{"type":"string","example":"google"}}}}}},"ForgottenPasswordBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","example":"example@test.com"}}}}}},"ResetPasswordBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["password"],"properties":{"password":{"type":"string","minLength":8,"example":"mynewpassword"}}}}}},"WorkshopBody":{"description":"Infos of the workshop to add","required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","startAt","coachId"],"properties":{"title":{"type":"string","minLength":1,"maxLength":128,"example":"Atelier Data 4 Good"},"startAt":{"type":"string","format":"date-time","example":"2020-04-01T00:00:00.000Z"},"location":{"type":"string","minLength":1,"maxLength":256,"example":"Data 4 Good"},"coachId":{"type":"string","example":1234567890},"eventUrl":{"type":"string","example":"http://www.example.com"},"registrationUrl":{"type":"string","example":"https://www.eventbrite.fr/e/billets-2tonnes-atelier-en-ligne-123456789"},"organisationUsageAgreedAt":{"type":"string","format":"date-time"}}}}}},"WorkshopParticipantBody":{"required":true,"description":"Infos of a participant ot add","content":{"application/json":{"schema":{"type":"object","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","minLength":1,"maxLength":64,"example":"Firstname"},"lastName":{"type":"string","minLength":1,"maxLength":64,"example":"Lastname"},"email":{"type":"string","minLength":1,"maxLength":256,"example":"example@test.com"},"carbonFormAnswersId":{"type":"string","example":"id"}}}}}},"WorkshopParticipantsActionBody":{"required":true,"description":"List of participants ids","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}},"example":["participantId1","participantId2"]}}},"ActionCardBatchesBody":{"required":true,"description":"Data to update","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["number","title","type","actionCardIds"],"properties":{"actionCardId":{"type":"string"},"number":{"type":"integer","example":1},"title":{"type":"string","example":"Lot 1"},"type":{"type":"string","enum":["individual","collective"]},"actionCardIds":{"type":"array","items":{"type":"string"},"example":["actionCard1","actionCard2"]}}}}}}},"WorkshopRoundBody":{"required":true,"description":"Infos of a workshop round to add\n\nIf roundConfig.actionCardType = \"individual\", then roundConfig.individualBudget is required.\n\nIf roundConfig.actionCardType = \"collective\", then collectiveBudget is required.\n","content":{"application/json":{"schema":{"type":"object","required":["status","year","roundConfig"],"properties":{"year":{"type":"integer","example":2020},"status":{"type":"string","enum":["created","opened","closed","ended"]},"collectiveBudget":{"type":"integer","example":3},"roundConfig":{"type":"object","required":["actionCardType","targetedYear"],"properties":{"actionCardType":{"type":"string","enum":["individual","collective"]},"targetedYear":{"type":"integer","example":2023},"individualBudget":{"type":"integer","example":4},"actionCardBatchIds":{"type":"array","items":{"type":"string"},"example":["actionCardBatchId1","actionCardBatchId2"]}}}}}}}},"AddOrRemoveFacilitatorPathBadgeBody":{"required":true,"description":"Data of the badge to add or remove","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"badgeType":{"type":"string","enum":["levels","levelsAsPro","audiences","simulationModels"]},"badgeKey":{"type":"string"}}}}}}}},"schemas":{"Error":{"type":"object","properties":{"msg":{"type":"string","example":"Error type: Error msg"},"details":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"example":{"fieldName1":["Issue 1","Issue 2"],"fieldName2":["Issue 3","Issue 4"]}}}},"User":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"example":1},"firstName":{"type":"string","minLength":1,"maxLength":64,"example":"Firstname"},"lastName":{"type":"string","minLength":1,"maxLength":64,"example":"Lastname"},"email":{"type":"string","minLength":1,"maxLength":256,"example":"example@test.com"},"country":{"type":"string","example":"France"},"postalCode":{"type":"string","example":94800},"company":{"type":"string","example":"2Tonnes"},"licenseAcceptedAt":{"type":"string","format":"date-time","writeOnly":true,"example":"2020-04-01T00:00:00.000Z"},"lastLoginAt":{"type":"string","format":"date-time","example":"2022-04-01T00:00:00.000Z"}}},"UserMe":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"example":1},"firstName":{"type":"string","minLength":1,"maxLength":64,"example":"Firstname"},"lastName":{"type":"string","minLength":1,"maxLength":64,"example":"Lastname"},"email":{"type":"string","minLength":1,"maxLength":256,"example":"example@test.com"},"licenseAcceptedAt":{"type":"string","format":"date-time","writeOnly":true,"example":"2020-04-01T00:00:00.000Z"},"role":{"type":"string","enum":["participant","coach","admin"]},"organisations":{"type":"array","items":{"$ref":"#/components/schemas/CoachOrganisation"}},"currentTenant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"2tonnes"}}}}},"Coach":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"role":{"type":"array","items":{"type":"string","enum":["participant","persona","coach","trainer","instructor","admin"]}},"city":{"type":"string"},"allowedModels":{"type":"array","items":{"type":"string"},"example":["france","world"]},"phoneNumber":{"type":"string","example":"0123456789"},"isAdmin":{"type":"boolean"},"socialMediaLinks":{"type":"array","items":{"$ref":"#/components/schemas/URLLink"}}}}]},"PatchCoach":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"city":{"type":"string"},"role":{"type":"string","enum":["admin","coach"],"example":"admin"},"allowedModels":{"type":"array","items":{"type":"string"},"example":["france","world"]}}}]},"Participant":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"role":{"readOnly":true,"type":"array","items":{"type":"string"},"example":["participant"]}}}]},"Workshop":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"key":{"type":"string","example":"world"},"name":{"type":"string","minLength":1,"maxLength":128,"example":"Atelier Data 4 Good"},"startAt":{"type":"string","format":"date-time","example":"2020-04-01T00:00:00.000+00:00"},"location":{"type":"string","minLength":1,"maxLength":256,"example":"Data 4 Good"},"coachId":{"type":"string","example":"coachId1"},"creatorId":{"type":"string","example":"creatorId1","readOnly":true},"eventUrl":{"type":"string","example":"http://www.example.com"},"registrationUrl":{"type":"string","example":"https://www.eventbrite.fr/e/billets-2tonnes-atelier-en-ligne-123456789"},"isTest":{"type":"boolean","example":true},"status":{"type":"string","enum":["created","ongoing","ended"]},"format":{"type":"string","enum":["faceToFace","remote"],"example":"1 avenue des Champs Elysée"},"context":{"type":"string","enum":["company","school","association","collectivity","private","other"]},"contextMore":{"type":"string"},"note":{"type":"string"},"description":{"type":"string"},"modelId":{"type":"string"},"organisationId":{"type":"string"},"organisationUsageAgreedAt":{"type":"string","format":"date-time","writeOnly":true},"modelKey":{"type":"string","readOnly":true},"modelVersion":{"type":"string","readOnly":true},"modelActionCardsVersion":{"type":"string","readOnly":true}}},"PatchWorkshop":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128,"example":"Atelier Data 4 Good"},"startAt":{"type":"string","format":"date-time","example":"2020-04-01T00:00:00.000Z"},"coachId":{"type":"string","example":"coachId1"},"isTest":{"type":"boolean","example":true},"format":{"type":"string","enum":["faceToFace","remote"],"example":"1 avenue des Champs Elysée"},"context":{"type":"string","enum":["company","school","association","collectivity","private","other"]},"contextMore":{"type":"string"},"note":{"type":"string"},"description":{"type":"string"},"organisationId":{"type":"string"},"organisationUsageAgreedAt":{"type":"string","format":"date-time","writeOnly":true},"status":{"type":"string","enum":["created","ongoing","ended"]}}},"WorkshopDetail":{"allOf":[{"$ref":"#/components/schemas/Workshop"},{"type":"object","properties":{"startYear":{"type":"integer","example":2020},"endYear":{"type":"integer","example":2050},"yearIncrement":{"type":"integer","example":3},"currentYear":{"type":"integer","example":2026},"updatedAt":{"readOnly":true,"type":"string","format":"date-time","example":"2020-04-01T00:00:00.000Z"},"carbonFormUrl":{"type":"string","readOnly":true,"example":"http:carbon_form_url_example.com"},"tCO2ePopulation2050":{"type":"number","writeOnly":true,"example":3.5},"organisationUsageAgreedAt":{"type":"string","format":"date-time"},"rounds":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRound"}}}}]},"WorkshopParticipant":{"type":"object","oneOf":[{"type":"object","properties":{"id":{"type":"string"},"workshopId":{"type":"string"},"user":{"$ref":"#/components/schemas/Participant"},"status":{"type":"string","enum":["created","form_sent","data_to_check","ready"]},"surveyVariables":{"$ref":"#/components/schemas/SurveyVariables"},"emailSentAt":{"type":"array","items":{"type":"string","format":"date-time"},"example":["2020-04-01T00:00:00.000Z"]}}},{"type":"object","properties":{"id":{"type":"string"},"personaId":{"type":"string"},"personaFirstName":{"type":"string"},"personaLastName":{"type":"string"},"status":{"type":"string","enum":["created","form_sent","data_to_check","ready"]},"carbonFormAnswersId":{"type":"string"},"surveyVariables":{"$ref":"#/components/schemas/SurveyVariables"}}}]},"WorkshopParticipantActions":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"workshopId":{"type":"string","readOnly":true},"workshopParticipantId":{"type":"string","readOnly":true},"actionCardIds":{"type":"array","items":{"type":"string","example":["actionCardIId1","actionCardIId2"]}},"tCO2ePrevented":{"type":"number","example":0.4}}},"CarbonFormAnswers":{"type":"object","properties":{"id":{"type":"string","example":1,"readOnly":true},"userId":{"type":"string","readOnly":true},"answers":{"type":"object","additionalProperties":{"type":"string"},"example":{"gram_of_meat_per_day":"200,","car_type":"electric"}},"createdAt":{"type":"string","format":"date-time","readOnly":true}}},"ModelFootprintStructure":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/ModelFootprintStructure"},{"type":"string"}]},"example":{"transport":{"plane":"cf_plane","train":{"urbanTrain":"cf_urban_train","mainlineTrain":"cf_country_train"}}}},"ModelVariableFormulas":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/JsonLogic"},"example":{"cf_plane":{"*":[{"var":"km_plane"},{"var":"EI_PLANE"}]},"cf_urban_train":{"*":[{"var":"hours_urban_train_per_week"},{"var":"MEAN_SPEED_URBAN_TRAIN"},{"var":"EI_URBAN_TRAIN"},{"var":"WEEKS_PER_YEAR"}]},"cf_country_train":{"*":[{"var":"km_country_train"},{"var":"EI_COUNTRY_TRAIN"}]}}},"ModelGlobalCarbonVariables":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/ModelGlobalCarbonVariables"},{"type":"string"}]},"example":{"EI_PLANE":0.25,"EI_URBAN_TRAIN":0.01,"EI_COUNTRY_TRAIN":0.01,"MEAN_SPEED_URBAN_TRAIN":25,"WEEKS_PER_YEAR":52}},"Model":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"key":{"type":"string","example":"france"},"version":{"type":"string","example":"1.0.0"},"actionCardsVersion":{"type":"string","example":"1.0"}}},"ModelDetail":{"allOf":[{"$ref":"#/components/schemas/Model"},{"type":"object","properties":{"footprintStructure":{"$ref":"#/components/schemas/ModelFootprintStructure"},"variableFormulas":{"$ref":"#/components/schemas/ModelVariableFormulas"},"globalCarbonVariables":{"$ref":"#/components/schemas/ModelGlobalCarbonVariables"},"localCarbonVariables":{"type":"object"},"surveyVariablesSchema":{"type":"object"},"actionCards":{"type":"array","items":{"$ref":"#/components/schemas/ActionCard"}},"actionCardBatches":{"type":"array","items":{"$ref":"#/components/schemas/ActionCardBatch"}},"personas":{"type":"array","items":{"$ref":"#/components/schemas/Persona"}},"citizens":{"type":"array","items":{"$ref":"#/components/schemas/Citizen"}}}}]},"ActionCard":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"cardNumber":{"type":"integer","example":1},"key":{"type":"string","example":"AI_Velo"},"name":{"type":"string","example":"Se déplacer à pieds ou à vélo"},"type":{"type":"string","enum":["individual","collective"]},"category":{"type":"string","enum":["eco-friendly action","awareness","system"]},"sector":{"type":"string","enum":["transport","housing","food","household","services","energy","education","awareness","activism","lobby","professional"]},"cost":{"type":"integer","example":3},"impactType":{"type":"string","enum":["individual","collective"]},"peerInspirationScore":{"type":"integer","example":3},"peerAwarenessScore":{"type":"integer","example":3},"systemicWeakSignals":{"type":"integer","example":3},"systemicPressureScore":{"type":"integer","example":3},"reluctancyForCitizens":{"type":"integer","example":3},"operations":{"type":"array","items":{"$ref":"#/components/schemas/ActionCardOperation"}}}},"ActionCardOperation":{"type":"object","properties":{"variable":{"type":"string","example":"variable_1"},"operation":{"$ref":"#/components/schemas/JsonLogic"}}},"ActionCardBatch":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Lot 1"},"type":{"type":"string","enum":["individual","collective"]},"actionCardIds":{"type":"array","items":{"type":"string"},"example":["actionCard1","actionCard2"]}}},"OrganisationDetails":{"allOf":[{"$ref":"#/components/schemas/Organisation"},{"type":"object","properties":{"description":{"type":"string"},"adminNotes":{"type":"string"},"organisationAdminNotes":{"type":"string"},"links":{"type":"array","items":{"$ref":"#/components/schemas/URLLink"}}}}]},"Organisation":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","enum":["association","school","company","collectivity","service_provider"]},"confidentiality":{"type":"string","enum":["public","private"]},"deploymentType":{"type":"string","enum":["external_services","external_general_public","internal_organic","internal_strategic","other"]},"allowedModels":{"type":"array","items":{"type":"string"},"example":["france","world"]},"zone":{"type":"string"},"groupTag":{"type":"string"}}},"CoachOrganisation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"role":{"type":"string","enum":["member","admin"]}}},"OrganisationMember":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisationId":{"type":"string","readOnly":true},"userId":{"type":"string","writeOnly":true},"email":{"type":"string","writeOnly":true},"user":{"type":"object","properties":{"id":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"}},"readOnly":true},"role":{"type":"string","enum":["admin","member"]},"position":{"type":"string"}}},"Persona":{"type":"object","properties":{"id":{"type":"string"},"firstName":{"type":"string","example":"Prenom"},"lastName":{"type":"string","example":"Nom"},"description":{"type":"string","example":"Nom"},"surveyVariables":{"$ref":"#/components/schemas/SurveyVariables"}}},"Citizen":{"type":"object","properties":{"id":{"type":"string"},"firstName":{"type":"string","example":"Prenom"},"lastName":{"type":"string","example":"Nom"},"description":{"type":"string","example":"Nom"},"surveyVariables":{"$ref":"#/components/schemas/SurveyVariables"}}},"SurveyVariables":{"type":"object","additionalProperties":{"type":"number"},"example":{"hours_urban_train_per_week":10,"km_country_train":5,"km_plane":200}},"WorkshopRound":{"type":"object","properties":{"year":{"type":"integer","example":2020},"status":{"type":"string","enum":["created","opened","closed","ended"]},"carbonVariables":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRoundCarbonVariables"}},"carbonFootprints":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRoundCarbonFootprint"}},"citizenCarbonVariables":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRoundCitizenCarbonVariables"}},"citizenCarbonFootprints":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRoundCitizenCarbonFootprint"}},"simplifiedCarbonFootprints":{"$ref":"#/components/schemas/WorkshopRoundSimplifiedCarbonFootprint"},"roundConfig":{"$ref":"#/components/schemas/RoundConfig"},"globalCarbonVariables":{"$ref":"#/components/schemas/ModelGlobalCarbonVariables"},"collectiveChoices":{"$ref":"#/components/schemas/WorkshopRoundCollectiveChoices"},"indivualChoices":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRoundIndividualChoices"}},"citizenIndivualChoices":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopRoundCitizenIndividualChoices"}},"socialVariables":{"$ref":"#/components/schemas/WorkshopRoundSocialVariables"},"collectiveBudget":{"type":"integer","example":3},"createdAt":{"type":"string","readOnly":true,"format":"date-time","example":"2020-04-01T00:00:00.000Z"},"updatedAt":{"type":"string","readOnly":true,"format":"date-time","example":"2020-04-01T00:00:00.000Z"}}},"RoundConfig":{"type":"object","properties":{"actionCardType":{"type":"string","enum":["individual","collective"]},"targetedYear":{"type":"integer","example":2023},"individualBudget":{"type":"integer","example":4},"actionCardBatchIds":{"type":"array","items":{"type":"string"},"example":["actionCardBatchId1","actionCardBatchId2"]}}},"WorkshopRoundSocialVariables":{"type":"object","properties":{"socialScore":{"type":"number","example":1.5},"influenceScore":{"type":"number","example":2.2}}},"WorkshopRoundCollectiveChoices":{"type":"object","properties":{"actionCardIds":{"type":"array","items":{"type":"string"},"example":["actionId10","actionId12"]}}},"WorkshopRoundIndividualChoices":{"type":"object","properties":{"participantId":{"type":"string","example":"participantId1"},"actionCardIds":{"type":"array","items":{"type":"string"},"example":["actionId9","actionId11"]}}},"WorkshopRoundCitizenIndividualChoices":{"type":"object","properties":{"citizenId":{"type":"string","example":"citizenId1"},"actionCardIds":{"type":"array","items":{"type":"string"},"example":["actionId9","actionId11"]}}},"WorkshopRoundCarbonVariables":{"type":"object","properties":{"participantId":{"type":"string","example":"participantId1"},"variables":{"$ref":"#/components/schemas/CarbonVariables"}}},"WorkshopRoundCarbonFootprint":{"type":"object","properties":{"participantId":{"type":"string","example":"participantId1"},"footprint":{"$ref":"#/components/schemas/CarbonFootprint"}}},"WorkshopRoundCitizenCarbonVariables":{"type":"object","properties":{"citizenId":{"type":"string","example":"participantId1"},"variables":{"$ref":"#/components/schemas/CarbonVariables"}}},"WorkshopRoundCitizenCarbonFootprint":{"type":"object","properties":{"citizenId":{"type":"string","example":"participantId1"},"footprint":{"$ref":"#/components/schemas/CarbonFootprint"}}},"CarbonVariables":{"type":"object","additionalProperties":{"type":"number"},"example":{"hours_urban_train_per_week":10,"km_country_train":5,"km_plane":200}},"CarbonFootprint":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/CarbonFootprint"},{"type":"number"}]},"example":{"transport":{"plane":1000,"train":{"urbanTrain":100,"mainlineTrain":500}}}},"WorkshopRoundSimplifiedCarbonFootprint":{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"participantId":{"type":"string","example":"participantId1"},"footprint":{"type":"object","example":[150,[[50,[10,40]],[100,[70,30]]]]}}}},"averages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","example":"nationalAverage"},"country":{"type":"string","example":"FRA"},"footprint":{"type":"object","example":[150,[[50,[10,40]],[100,[70,30]]]]}}}}}},"JsonLogic":{"type":"object","additionalProperties":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/JsonLogic"},{"type":"string"},{"type":"number"}]}},"example":{"operator":["value1","value2"]}},"IndividualChoice":{"type":"object","properties":{"workshopParticipantId":{"type":"string","example":"participantId1","readOnly":true},"actionCardIds":{"type":"array","items":{"type":"string"},"example":["actionId1","actionId2"]}}},"CoachStatistics":{"type":"object","properties":{"totalWorkshops":{"type":"number","example":2},"totalParticipants":{"type":"number","example":3},"totalCommitedActions":{"type":"number","example":5},"workshops":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","example":"workshop_name"},"startAt":{"type":"string","format":"date-time","example":"2020-04-01T00:00:00.000Z"},"tCO2ePopulation2050":{"type":"number","example":3.5},"commitedActions":{"type":"number","example":6},"tCO2ePrevented":{"type":"number","example":2.3}}}}}},"OrganisationStatistics":{"type":"object","properties":{"totalWorkshops":{"type":"number","example":2},"totalParticipants":{"type":"number","example":3},"totalCommitedActions":{"type":"number","example":5},"workshops":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","example":"workshop_name"},"startAt":{"type":"string","format":"date-time","example":"2020-04-01T00:00:00.000Z"},"tCO2ePopulation2050":{"type":"number","example":3.5},"commitedActions":{"type":"number","example":6},"tCO2ePrevented":{"type":"number","example":2.3},"coach":{"type":"object","properties":{"email":{"type":"string"}}}}}}}},"URLLink":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}},"RegisteredUser":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string","format":"date-time","example":"2022-12-12T12:27:26Z"}}},"FacilitatorPathEvent":{"type":"object","properties":{"eventId":{"type":"string"},"eventType":{"type":"string","enum":["training","auto_training","manual_update","cooptation"]},"createdBy":{"type":"object","readOnly":true,"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"}}},"createdAt":{"type":"string","format":"date-time","example":"2020-04-01T00:00:00.000Z"}}},"FacilitatorPathBadge":{"type":"object","properties":{"key":{"type":"string"},"obtainedDate":{"type":"string","format":"date","example":"2020-04-01"},"facilitatorPathEvent":{"$ref":"#/components/schemas/FacilitatorPathEvent"}}},"FacilitatorPathRole":{"type":"object","properties":{"obtainedDate":{"type":"string","format":"date","example":"2020-04-01"},"facilitatorPathEvent":{"$ref":"#/components/schemas/FacilitatorPathEvent"},"levels":{"type":"array","items":{"$ref":"#/components/schemas/FacilitatorPathBadge"}},"levelsAsPro":{"type":"array","items":{"$ref":"#/components/schemas/FacilitatorPathBadge"}},"audiences":{"type":"array","items":{"$ref":"#/components/schemas/FacilitatorPathBadge"}},"simulationModels":{"type":"array","items":{"$ref":"#/components/schemas/FacilitatorPathBadge"}}}},"FacilitatorPath":{"type":"object","properties":{"coach":{"$ref":"#/components/schemas/FacilitatorPathRole"},"trainer":{"$ref":"#/components/schemas/FacilitatorPathRole"},"instructor":{"$ref":"#/components/schemas/FacilitatorPathRole"}}},"Training":{"type":"object","properties":{"id":{"type":"string"},"audienceKey":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"address":{"type":"string"},"onlineEventUrl":{"type":"string"},"registrationUrl":{"type":"string"},"asyncTrainingRecommended":{"type":"string"},"hostId":{"type":"string"},"hostEmail":{"type":"string","readOnly":true},"creatorId":{"type":"string","readOnly":true},"status":{"type":"string","enum":["created","ongoing","cancelled","ended"]},"format":{"type":"string","enum":["faceToFace","remote","mix"]},"targetRoleKey":{"type":"string"},"targetLevelKey":{"type":"string","enum":["beginner","confirmed","expert"]},"targetAudienceKey":{"type":"string","readOnly":true},"targetSimulationModelKey":{"type":"string"},"targetOrganisationsIds":{"type":"array","items":{"type":"string"}}}},"TrainingParticipantProfile":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"}}},"TrainingParticipant":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","registered","cancelled","absent","participated"]},"trainingId":{"type":"string"},"userId":{"type":"string"},"importOrigin":{"type":"string","enum":["manual","eventbrite"]},"emailInvitationSentAt":{"type":"string","format":"date-time"},"externalInscriptionDate":{"type":"string","format":"date"},"userOrganisationsUpgradedAt":{"type":"object","properties":{"organisation_id":{"type":"string","format":"date-time"}}},"profile":{"$ref":"#/components/schemas/TrainingParticipantProfile"}}},"Audience":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"type":{"type":"string","enum":["general_public","students","colleagues","clients","organisations"]},"trainingTargetAudienceKey":{"type":"string"},"allowedRoles":{"type":"array","items":{"type":"string","enum":["coach","trainer","instructor"]}}}}}}}