{"openapi":"3.0.3","info":{"title":"API Doc - 4156 Project","contact":{"email":"qx2233@columbia.edu"},"version":"1.0.0"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/dearalina/4156-Project/1.0.0"}],"tags":[{"name":"event"},{"name":"user"},{"name":"auth"}],"paths":{"/events":{"post":{"tags":["event"],"summary":"Allows clients to create a new event","description":"Allows clients to create a new event","requestBody":{"description":"Event to be created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventCreateReq"}}},"required":true},"responses":{"200":{"description":"Event successfully created"},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":400},"message":{"type":"string","example":"Host not found in user database"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["event"],"summary":"Get a list of events organized or participated in by the user","parameters":[{"name":"pid","in":"query","required":true,"description":"Optionally filter by the ID of the event organizer.","schema":{"type":"string","example":"abcdef"}}],"responses":{"200":{"description":"Get event list successfully."}}}},"/events/{id}":{"get":{"summary":"View event details","tags":["event"],"parameters":[{"name":"id","in":"path","required":true,"description":"The unique ID of the event.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved event details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDetail"}}}},"404":{"description":"Event not found."},"500":{"description":"Internal server error."}}},"patch":{"tags":["event"],"summary":"Edit an existing event","description":"Allows hosts to modify details of an existing event.","parameters":[{"name":"id","in":"path","description":"ID of event that needs to be updated","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Updated event details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventUpdateReq"}}},"required":true},"responses":{"200":{"description":"Event successfully updated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Event updated successfully."}}}}}},"404":{"description":"Not found. The specified event does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":404},"message":{"type":"string","example":"Event not found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["event"],"summary":"Cancel an event","description":"Allows the host to cancel a specific event.","parameters":[{"name":"id","in":"path","description":"The unique ID of the event to be canceled.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Event successfully deleted.","content":{"application/json":{"schema":{"type":"boolean","example":true,"description":"status of the event delete."}}}},"404":{"description":"Not found. The specified event does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":404},"message":{"type":"string","example":"Event not found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInDTO"}}},"required":true},"responses":{"200":{"description":"Authentication success."},"400":{"description":"Bad request."},"500":{"description":"Internal server error."}}}},"/auth/register":{"post":{"tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpDTO"}}},"required":true},"responses":{"200":{"description":"Authentication success."},"400":{"description":"Bad request."},"500":{"description":"Internal server error."}}}}},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"UserBasicDetail":{"type":"object","properties":{"id":{"type":"string","example":"abcdef"},"email":{"type":"string","example":"johnjay@gmail.com"}}},"UserDetail":{"type":"object","properties":{"id":{"type":"string","example":"abcdef"},"firstname":{"type":"string","example":"John"},"lastname":{"type":"string","example":"Jay"},"email":{"type":"string","example":"johnjay@gmail.com"},"password":{"type":"string","example":"1234554321"},"role":{"type":"string","example":"1234554321"},"createdAt":{"type":"string","format":"date","example":"2023-10-28T14:30:00Z"},"updatedAt":{"type":"string","format":"date","example":"2023-10-29T23:30:00Z"}}},"UserUpdateDTO":{"type":"object","properties":{"firstname":{"type":"string","example":"John"},"lastname":{"type":"string","example":"Jay"}}},"EventDetail":{"type":"object","properties":{"id":{"type":"string","example":"abcdef"},"title":{"type":"string","example":"Halloween Party"},"desc":{"type":"string","example":"Get ready for a spooktacular Halloween Party on October 28, 2023 - a night filled with fright, fun, and fabulous costumes!"},"start_time":{"type":"string","format":"date","example":"2023-10-28T14:30:00Z"},"end_time":{"type":"string","format":"date","example":"2023-10-29T23:30:00Z"},"location":{"type":"string","example":"116 St, New York, NY 10025"},"host":{"type":"string","example":"qwerty"},"participants":{"type":"array","items":{"type":"object"}},"cid":{"type":"string","example":"asdfghjk"}}},"SignInDTO":{"type":"object","required":["access_id","access_secret"],"properties":{"access_id":{"type":"string","example":"qwertyu"},"access_secret":{"type":"string","example":"qwertyu"}}},"SignUpDTO":{"type":"object","required":["access_id","access_secret"],"properties":{"access_id":{"type":"string","example":"qwertyu"},"access_secret":{"type":"string","example":"qwertyu"}}},"EventCreateReq":{"type":"object","required":["title","desc","start_time","end_time","location","host"],"properties":{"title":{"type":"string","example":"Halloween Party"},"start_time":{"type":"string","format":"date","example":"2023-10-28T14:30:00Z"},"end_time":{"type":"string","format":"date","example":"2023-10-29T23:30:00Z"},"location":{"type":"string","example":"116 St, New York, NY 10025"},"desc":{"type":"string","example":"Get ready for a spooktacular Halloween Party on October 28, 2023 - a night filled with fright, fun, and fabulous costumes!"},"participants":{"type":"array","items":{"type":"string"}},"host":{"type":"string"},"host_email":{"type":"string","format":"email","example":"host@example.com"},"host_name":{"type":"string","example":"John Doe"},"participants_email":{"type":"array","items":{"type":"string","format":"email"},"example":["alice@example.com","bob@example.com"]},"participants_name":{"type":"array","items":{"type":"string"},"example":["Alice Smith","Bob Johnson"]}}},"EventUpdateReq":{"type":"object","properties":{"title":{"type":"string","example":"Halloween Party"},"start_time":{"type":"string","format":"date","example":"2023-10-28T14:30:00Z"},"end_time":{"type":"string","format":"date","example":"2023-10-29T23:30:00Z"},"location":{"type":"string","example":"116 St, New York, NY 10025"},"desc":{"type":"string","example":"Get ready for a spooktacular Halloween Party on October 28, 2023 - a night filled with fright, fun, and fabulous costumes!"},"participants":{"type":"array","items":{"type":"string"}},"host_email":{"type":"string","format":"email","example":"host@example.com"},"host_name":{"type":"string","example":"John Doe"},"participants_email":{"type":"array","items":{"type":"string","format":"email"},"example":["alice@example.com","bob@example.com"]},"participants_name":{"type":"array","items":{"type":"string"},"example":["Alice Smith","Bob Johnson"]}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"A short description of the error."}}}}}}