basePath: / definitions: types.Contacts: properties: facebook: type: string instagram: type: string linkedin: type: string phone: type: string type: object types.ContactsRequest: properties: approved_contacts: additionalProperties: type: string type: object blocked_users: additionalProperties: type: string type: object confirmed_contacts_requests: additionalProperties: type: string type: object incoming_contact_requests: additionalProperties: type: string type: object outgoing_contact_requests: additionalProperties: type: string type: object type: object types.Event: properties: _id: type: string cover: type: string created_by: type: string date: type: string description: $ref: '#/definitions/types.Translations' links: type: string location: type: string orgs: type: string slug: type: string title: $ref: '#/definitions/types.Translations' required: - date type: object types.FileResponce: properties: url: type: string type: object types.ForgotPassword: properties: email: type: string required: - email type: object types.Location: properties: _id: type: string city: type: string country: type: string extra_info: type: string house: type: string region: type: string settlement: type: string street: type: string value: type: string required: - country - value type: object types.ModerationStatus: enum: - pending - approved - rejected type: string x-enum-varnames: - Pending - Approved - Rejected types.Project: properties: _id: type: string applicants: additionalProperties: type: boolean type: object covers: items: type: string type: array created_by: type: string description: $ref: '#/definitions/types.Translations' how_to_help_the_project: type: string links: type: string moderation_status: $ref: '#/definitions/types.ModerationStatus' objective: $ref: '#/definitions/types.Translations' phase: type: string project_status: $ref: '#/definitions/types.ProjectStatus' reason_of_reject: type: string rejected_applicants: additionalProperties: type: boolean type: object request: type: string slug: type: string successful_applicants: additionalProperties: type: boolean type: object tags: items: type: string type: array title: $ref: '#/definitions/types.Translations' views: type: integer who_is_needed: $ref: '#/definitions/types.Translations' type: object types.ProjectStatus: enum: - ideation - implementation - launchAndExecution - perfomanceAndControl - closed type: string x-enum-varnames: - Ideation - Implementation - LaunchAndExecution - PerfomanceAndControl - Closed types.RequestMessage: properties: message: type: string type: object types.Research: properties: _id: type: string link: type: string source: type: string title: type: string required: - link - source type: object types.ResetPassword: properties: password: type: string password_confirm: type: string required: - password - password_confirm type: object types.Role: enum: - admin - specialist type: string x-enum-varnames: - Admin - Specialist types.Statistic: properties: _id: type: string category: type: string source: type: string title: type: string value: type: integer required: - category - source - value type: object types.Suggestions: properties: suggestions: items: additionalProperties: true type: object type: array type: object types.Tag: properties: _id: type: string title: $ref: '#/definitions/types.Translations' type: object types.Translations: properties: en: type: string hy: type: string ru: type: string type: object types.User: properties: _id: type: string avatar: type: string banned: type: boolean contacts: $ref: '#/definitions/types.Contacts' contacts_request: $ref: '#/definitions/types.ContactsRequest' description: type: string email: type: string events: additionalProperties: type: boolean type: object first_name: type: string is_email_verified: type: boolean job: type: string language: type: string last_name: type: string location: type: string notifications: items: type: string type: array password: type: string researches: additionalProperties: type: boolean type: object role: $ref: '#/definitions/types.Role' tags: items: type: string type: array user_projects: $ref: '#/definitions/types.UserProjects' required: - email type: object types.UserBody: properties: avatar: type: string banned: type: boolean contacts: $ref: '#/definitions/types.Contacts' contacts_request: $ref: '#/definitions/types.ContactsRequest' description: type: string events: additionalProperties: type: boolean type: object first_name: type: string job: type: string language: type: string last_name: type: string location: type: string notifications: items: type: string type: array researches: additionalProperties: type: boolean type: object role: $ref: '#/definitions/types.Role' tags: items: type: string type: array user_projects: $ref: '#/definitions/types.UserProjects' type: object types.UserProjects: properties: confirmed_applications: additionalProperties: type: string type: object created_projects: additionalProperties: type: boolean type: object projects_applications: additionalProperties: type: string type: object rejected_applicants: additionalProperties: type: string type: object type: object host: localhost:8080 info: contact: {} title: Henar version: "1.0" paths: /auth/forgot-password: post: consumes: - application/json description: Sends a password reset email to the user with the specified email address. parameters: - description: Forgot password request body in: body name: request required: true schema: $ref: '#/definitions/types.ForgotPassword' produces: - application/json responses: "200": description: You will receive a reset email if a user with that email exists schema: type: string "400": description: Error parsing request body or passwords do not match schema: type: string "500": description: Error retrieving user or updating user schema: type: string summary: Forgot password tags: - auth /auth/reset-password/{token}: post: consumes: - application/json description: Resets the password for the user using the provided reset token. parameters: - description: Reset token in: path name: resettoken required: true type: string - description: Reset password request body in: body name: request required: true schema: $ref: '#/definitions/types.ResetPassword' produces: - application/json responses: "200": description: Password successfully updated schema: type: string "400": description: The reset token is invalid or has expired, or error parsing request body or passwords do not match schema: type: string "500": description: Error retrieving user or updating user schema: type: string summary: Reset password tags: - auth /auth/verify-email/{email}: get: consumes: - application/json description: updates verification data and resends email with code parameters: - description: email in: path name: email required: true type: string produces: - application/json responses: "200": description: email resent successfully schema: type: string "400": description: email not found schema: type: string "500": description: Error resending email schema: type: string summary: resend verification email tags: - auth /auth/verify-email/{secret_code}: get: consumes: - application/json description: verifies the provided code then set the User state to verified and deletes verification data parameters: - description: Secret code in: path name: secret_code required: true type: string produces: - application/json responses: "200": description: Email confirmed successfully schema: type: string "400": description: The secret code is invalid or has expired schema: type: string "500": description: Error verifying email schema: type: string summary: Verify email tags: - auth /projects/cancel/{id}: get: consumes: - application/json description: Cancels the user's application for the specified project. parameters: - description: Project ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Project' "400": description: Invalid ID or project ID schema: type: string "500": description: Error connecting to database or updating/retrieving project schema: type: string summary: Cancel project application tags: - projects /projects/respond/{id}: get: consumes: - application/json description: Adds the current user as an applicant to the specified project. parameters: - description: Project ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Project' "400": description: Invalid ID or project ID schema: type: string "500": description: Error connecting to database or updating/retrieving project schema: type: string summary: Respond to a project tags: - projects /users: post: consumes: - application/json description: Creates a new user in the database produces: - application/json responses: "201": description: The created user schema: $ref: '#/definitions/types.User' "400": description: Bad request schema: type: string "500": description: Internal server error schema: type: string summary: Create a new user tags: - users /users/{id}: patch: consumes: - application/json description: Updates an existing user in the database parameters: - description: User ID in: path name: id required: true type: string - description: User details in: body name: user required: true schema: $ref: '#/definitions/types.UserBody' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.User' "400": description: Bad request schema: type: string "404": description: User not found schema: type: string "500": description: Internal server error schema: type: string summary: Update an existing user tags: - users /users/approve-contacts-request/{id}: get: consumes: - application/json description: Approves a contact request from the specified user. parameters: - description: User ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Done schema: type: string "400": description: Invalid project ID or user ID schema: type: string "404": description: User not found schema: type: string "500": description: Error connecting to database or updating user schema: type: string security: - ApiKeyAuth: [] summary: Approve contact request tags: - users /users/approve/{id}: get: consumes: - application/json description: Approves a project request for the user. parameters: - description: User ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Request approved successfully. schema: type: string "400": description: Invalid project ID or user ID schema: type: string "404": description: User not found schema: type: string "500": description: Error connecting to database or updating user schema: type: string summary: Approve project request tags: - users /users/reject-contacts-request/{id}: get: consumes: - application/json description: Rejects a contact request from the specified user. parameters: - description: User ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Done schema: type: string "400": description: Invalid project ID or user ID schema: type: string "404": description: User not found schema: type: string "500": description: Error connecting to database or updating user schema: type: string security: - ApiKeyAuth: [] summary: Reject contact request tags: - users /users/reject/{id}: get: consumes: - application/json description: Rejects a project request for the user. parameters: - description: User ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Request rejected successfully. schema: type: string "400": description: Invalid project ID or user ID schema: type: string "404": description: User not found schema: type: string "500": description: Error connecting to database or updating user schema: type: string summary: Reject project request tags: - users /users/request-contacts/{id}: post: consumes: - application/json description: Sends a contact request to the specified user. parameters: - description: User ID in: path name: id required: true type: string - description: Request body in: body name: body required: true schema: $ref: '#/definitions/types.RequestMessage' produces: - application/json responses: "200": description: Contact request added successfully. schema: type: string "400": description: Invalid project ID or user ID schema: type: string "404": description: User not found schema: type: string "500": description: Error connecting to database or updating user schema: type: string summary: Send contact request tags: - users /users/update-password: patch: consumes: - application/json description: Updates the password for a user. parameters: - description: User ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Password successfully updated schema: type: string "400": description: Error parsing request body or validating user schema: type: string "401": description: Wrong credentials schema: type: string "403": description: Permission or ownership error schema: type: string "404": description: User not found schema: type: string "500": description: Error connecting to database or updating user schema: type: string summary: Update password tags: - users /v1/events: get: consumes: - application/json description: Retrieves all events parameters: - description: Limit in: query name: limit type: integer - description: Offset in: query name: offset type: integer - description: Comma-separated list of sort fields and directions, e.g. views,-applicants,tags in: query name: sort type: string - description: Language code for the title (default 'en') in: query name: language type: string - description: Substring to match in the title in: query name: title type: string - description: Comma-separated list of tag IDs to filter by in: query name: tags type: string - description: Location ID to filter by in: query name: location type: string produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/types.Event' type: array "500": description: Internal Server Error schema: type: string summary: Get all events tags: - events post: consumes: - application/json description: Creates a new event parameters: - description: Event Object in: body name: event required: true schema: $ref: '#/definitions/types.Event' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/types.Event' "400": description: Bad Request schema: type: string "500": description: Internal Server Error schema: type: string summary: Create event tags: - events /v1/events/{id}: delete: consumes: - application/json description: Deletes a event document by its ID parameters: - description: Event ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Event deleted successfully schema: type: string "400": description: Invalid ID schema: type: string "404": description: Event not found schema: type: string "500": description: 'Error deleting event: ' schema: type: string summary: Delete event by ID tags: - events patch: consumes: - application/json description: Updates a event by its ID parameters: - description: Event ID in: path name: id required: true type: string - description: Event Object in: body name: event required: true schema: $ref: '#/definitions/types.Event' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Event' "400": description: Invalid ID or Bad Request schema: type: string "500": description: Internal Server Error schema: type: string summary: Update event by ID tags: - events /v1/events/{slug}: get: consumes: - application/json description: Retrieves a event by its slug parameters: - description: Event slug in: path name: slug required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Event' "400": description: Invalid slug schema: type: string "404": description: Event not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Get event by slug tags: - events /v1/files/upload: post: consumes: - multipart/form-data description: Upload a static file to Henar DigitalOcean failopoika's and get the uri produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/types.FileResponce' type: array "400": description: error reading file schema: type: string summary: Upload file tags: - files /v1/locations: get: consumes: - application/json description: Retrieves all locations parameters: - description: Limit in: query name: limit type: integer - description: Offset in: query name: offset type: integer produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/types.Location' type: array "500": description: Internal Server Error schema: type: string summary: Get all locations tags: - locations post: consumes: - application/json description: Creates a new research parameters: - description: Location Object in: body name: research required: true schema: $ref: '#/definitions/types.Location' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/types.Location' "400": description: Bad Request schema: type: string "500": description: Internal Server Error schema: type: string summary: Create research tags: - locations /v1/locations/{id}: delete: consumes: - application/json description: Deletes a research document by its ID parameters: - description: Location ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Location deleted successfully schema: type: string "400": description: Invalid ID schema: type: string "404": description: Location not found schema: type: string "500": description: 'Error deleting research: ' schema: type: string summary: Delete research by ID tags: - locations patch: consumes: - application/json description: Updates a research by its ID parameters: - description: Location ID in: path name: id required: true type: string - description: Location Object in: body name: research required: true schema: $ref: '#/definitions/types.Location' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Location' "400": description: Invalid ID or Bad Request schema: type: string "500": description: Internal Server Error schema: type: string summary: Update research by ID tags: - locations /v1/locations/{slug}: get: consumes: - application/json description: Retrieves a research by its slug parameters: - description: Location slug in: path name: slug required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Location' "400": description: Invalid slug schema: type: string "404": description: Location not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Get research by slug tags: - locations /v1/locations/suggestions: get: consumes: - application/json description: Returns a list of suggested addresses based on a query string. parameters: - description: Query string for location suggestions in: query name: q type: string - description: Language of response in: query name: lanquage type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Suggestions' "400": description: Invalid request parameters. schema: type: string "500": description: Internal server error. schema: type: string summary: Get Location Suggestions tags: - locations /v1/projects: get: consumes: - application/json description: Retrieves a list of all projects in the database. parameters: - description: Limit in: query name: limit type: integer - description: Offset in: query name: offset type: integer - description: Comma-separated list of sort fields and directions, e.g. views,-applicants,tags in: query name: sort type: string - description: Language code for the title (default 'en') in: query name: language type: string - description: Substring to match in the title in: query name: title type: string - description: Comma-separated list of tag IDs to filter by in: query name: tags type: string - description: Location ID to filter by in: query name: location type: string - description: Project statuses in: query name: status type: string - description: How to help the project in: query name: help type: string produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/types.Project' type: array "500": description: Internal Server Error schema: type: string summary: Get all projects tags: - projects post: consumes: - application/json description: Creates a new project in the database. parameters: - description: Project in: body name: project required: true schema: $ref: '#/definitions/types.Project' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/types.Project' "400": description: Error parsing request body schema: type: string "500": description: Internal Server Error schema: type: string summary: Create a project tags: - projects /v1/projects/{id}: delete: consumes: - application/json description: Deletes a project from the database based on the provided ID parameters: - description: Project ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Project deleted successfully schema: type: string "400": description: Invalid ID schema: type: string "404": description: Project not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Delete a project tags: - projects patch: consumes: - application/json description: Updates an existing project in the database. parameters: - description: Project ID in: path name: id required: true type: string - description: Project in: body name: project required: true schema: $ref: '#/definitions/types.Project' produces: - application/json responses: "204": description: No content "400": description: Invalid ID or error parsing request body schema: type: string "500": description: Internal Server Error schema: type: string summary: Update a project tags: - projects /v1/projects/{slug}: get: consumes: - application/json description: Retrieves a project by its slug and increments its view count. parameters: - description: Project slug in: path name: slug required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Project' "400": description: Invalid slug schema: type: string "404": description: Project not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Get a project by slug tags: - projects /v1/researches: get: consumes: - application/json description: Retrieves all researches parameters: - description: Limit in: query name: limit type: integer - description: Offset in: query name: offset type: integer - description: Comma-separated list of sort fields and directions, e.g. views,-applicants,tags in: query name: sort type: string - description: Language code for the title (default 'en') in: query name: language type: string - description: Substring to match in the title in: query name: title type: string - description: Comma-separated list of tag IDs to filter by in: query name: tags type: string - description: Location ID to filter by in: query name: location type: string produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/types.Research' type: array "500": description: Internal Server Error schema: type: string summary: Get all researches tags: - researches post: consumes: - application/json description: Creates a new research parameters: - description: Research Object in: body name: research required: true schema: $ref: '#/definitions/types.Research' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/types.Research' "400": description: Bad Request schema: type: string "500": description: Internal Server Error schema: type: string summary: Create research tags: - researches /v1/researches/{id}: delete: consumes: - application/json description: Deletes a research document by its ID parameters: - description: Research ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Research deleted successfully schema: type: string "400": description: Invalid ID schema: type: string "404": description: Research not found schema: type: string "500": description: 'Error deleting research: ' schema: type: string summary: Delete research by ID tags: - researches patch: consumes: - application/json description: Updates a research by its ID parameters: - description: Research ID in: path name: id required: true type: string - description: Research Object in: body name: research required: true schema: $ref: '#/definitions/types.Research' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Research' "400": description: Invalid ID or Bad Request schema: type: string "500": description: Internal Server Error schema: type: string summary: Update research by ID tags: - researches /v1/researches/{slug}: get: consumes: - application/json description: Retrieves a research by its slug parameters: - description: Research slug in: path name: slug required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Research' "400": description: Invalid slug schema: type: string "404": description: Research not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Get research by slug tags: - researches /v1/statistics: get: consumes: - application/json description: Retrieves all statistics parameters: - description: Limit in: query name: limit type: integer - description: Offset in: query name: offset type: integer produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/types.Statistic' type: array "500": description: Internal Server Error schema: type: string summary: Get all statistics tags: - statistics post: consumes: - application/json description: Creates a new statistic parameters: - description: Statistic Object in: body name: statistic required: true schema: $ref: '#/definitions/types.Statistic' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/types.Statistic' "400": description: Bad Request schema: type: string "500": description: Internal Server Error schema: type: string summary: Create statistic tags: - statistics /v1/statistics/{id}: delete: consumes: - application/json description: Deletes a statistic document by its ID parameters: - description: Statistic ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Statistic deleted successfully schema: type: string "400": description: Invalid ID schema: type: string "404": description: Statistic not found schema: type: string "500": description: 'Error deleting statistic: ' schema: type: string summary: Delete statistic by ID tags: - statistics get: consumes: - application/json description: Retrieves a statistic by its ID parameters: - description: Statistic ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Statistic' "400": description: Invalid ID schema: type: string "404": description: Statistic not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Get statistic by ID tags: - statistics patch: consumes: - application/json description: Updates a statistic by its ID parameters: - description: Statistic ID in: path name: id required: true type: string - description: Statistic Object in: body name: statistic required: true schema: $ref: '#/definitions/types.Statistic' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Statistic' "400": description: Invalid ID or Bad Request schema: type: string "500": description: Internal Server Error schema: type: string summary: Update statistic by ID tags: - statistics /v1/tags: get: consumes: - application/json description: Retrieves a list of all tags in the database parameters: - description: Limit in: query name: limit type: integer - description: Offset in: query name: offset type: integer produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/types.Tag' type: array "500": description: Internal Server Error schema: type: string summary: Get all tags tags: - tags post: consumes: - application/json description: Creates a new tag in the database parameters: - description: Tag object to create in: body name: tag required: true schema: $ref: '#/definitions/types.Tag' produces: - application/json responses: "201": description: Created tag object schema: $ref: '#/definitions/types.Tag' "400": description: Error parsing request body or validation error schema: type: string "500": description: Internal Server Error schema: type: string summary: Create a new tag tags: - tags /v1/tags/{id}: delete: description: Deletes a tag with the given ID from the database parameters: - description: Tag ID in: path name: id required: true type: string responses: "200": description: Tag deleted successfully schema: type: string "400": description: Invalid ID schema: type: string "404": description: Tag not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Delete tag by ID tags: - tags get: consumes: - application/json description: Retrieves a tag by its ID parameters: - description: Tag ID in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.Tag' "400": description: Invalid ID schema: type: string "404": description: Tag not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Get tag by ID tags: - tags patch: consumes: - application/json description: Updates a tag with the given ID in the database parameters: - description: Tag ID in: path name: id required: true type: string - description: Tag object to update in: body name: tag required: true schema: $ref: '#/definitions/types.Tag' produces: - application/json responses: "200": description: Updated tag object schema: $ref: '#/definitions/types.Tag' "400": description: Invalid ID or error parsing request body or validation error schema: type: string "500": description: Internal Server Error schema: type: string summary: Update tag by ID tags: - tags /v1/users: get: consumes: - application/json description: Retrieves all users parameters: - description: Limit in: query name: limit type: integer - description: Offset in: query name: offset type: integer - description: Comma-separated list of sort fields and directions, e.g. tags in: query name: sort type: string - description: Language code for the title (default 'en') in: query name: language type: string - description: Substring to match in the full name in: query name: full_name type: string - description: Substring to match in the job in: query name: job type: string - description: Comma-separated list of tag IDs to filter by in: query name: tags type: string - description: Location ID to filter by in: query name: location type: string produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/types.User' type: array "500": description: Internal Server Error schema: type: string summary: Get all users tags: - users /v1/users/{id}: delete: consumes: - application/json description: Deletes a user document by its ID parameters: - description: User ID in: path name: id required: true type: string produces: - application/json responses: "200": description: User deleted successfully schema: type: string "400": description: Invalid ID schema: type: string "404": description: User not found schema: type: string "500": description: 'Error deleting user: ' schema: type: string summary: Delete user by ID tags: - users get: consumes: - application/json description: Retrieves a user by its id parameters: - description: 'User ' in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.User' "400": description: Invalid id schema: type: string "404": description: User not found schema: type: string "500": description: Internal Server Error schema: type: string summary: Get user by id tags: - users swagger: "2.0"