API Endpoints
A list of all the endpoints in the API
Authentication
Register
POST
Request:
POST /register
Content-Type: application/json
{
"email": "[email protected]",
"password": "secure_password123",
"displayName": "John Doe"
}
Required Fields:
email: User's email addresspassword: User's passworddisplayName: User's display name
Response: 201 Created
{
"message": "User registered successfully. Please verify your email."
}
Login
POST
Request:
POST /login
Content-Type: application/json
{
"email": "[email protected]",
"password": "secure_password123"
}
Required Fields:
email: User's email addresspassword: User's password
Response: 200 OK
{
"message": "Login successful",
"access_token": "eyJhbGc..."
}
Delete Account
DELETE
Request:
DELETE /delete-user
Headers:
| Name | Value | Description |
|---|---|---|
| Authorization | Bearer token | JWT access token obtained from login |
Response: 200 OK
{
"message": "User deleted successfully"
}
Data management
Works
Dataset of musical works.
GET
Request:
GET /get-works
Query Parameters:
id: Query by work idname: Query by namecomposer_id: Query by composer id
Response: 200 OK
{
"about": null,
"composer_id": 1,
"date": "1885-10-25T12:00:00+00:00",
"duration_seconds": null,
"id": 1,
"mvt1_title": "Allegro non troppo",
"mvt2_title": "Andante moderato",
"mvt3_title": "Allegro giocoso",
"mvt4_title": "Allegro energico e passionato",
"mvt5_title": null,
"mvt6_title": null,
"name": "Symphony No. 4 in E minor",
"opus_no": "98"
}
POST
Request:
POST /add-work
Content-Type: application/json
{
"name": "Symphony No. 5",
"composer_id": "123",
"duration_seconds": 1800,
"opus_no": "67",
"date": "1808-12-22T00:00:00+00:00",
"mvt1_title": "Allegro con brio",
"mvt2_title": "Andante con moto"
}
Required Fields:
name: The name of the musical workcomposer_id: ID of the composer who wrote the workduration_seconds: Duration of the work in seconds
Optional Fields:
opus_no: The opus number of the workdate: ISO 8601 timestamp (e.g., "YYYY-MM-DDTHH:mm:ss+00:00")mvt1_title: Title of the first movementmvt2_title: Title of the second movementmvt3_title: Title of the third movementmvt4_title: Title of the fourth movementmvt5_title: Title of the fifth movementmvt6_title: Title of the sixth movement
Response: 201 Created
{
"message": "Work added successfully!",
"work_id": "456"
}
Composers
Dataset of composers.
GET
Request:
GET /get-composers
Query Parameters:
id: Query by composer idname: Query by namelocation_id: Query by city id
Response: 200 OK
{
"birth": "1833-05-07T12:00:00+00:00",
"death": "1897-04-03T12:00:00+00:00",
"id": 1,
"img_url": "https://concertly.s3.eu-north-1.amazonaws.com/composer-images/brahms.png",
"location_id": 6,
"name": "Johannes Brahms"
}
Concerts
Dataset of concerts.
GET
Request:
GET /get-concerts
Query Parameters:
id: Query by concert idvenue_id: Query by venue idtitle: Query by title
Response: 200 OK
{
"date": "2025-01-29T18:30:00+00:00",
"id": 4,
"img_url": null,
"overview": "This is overview text.",
"title": "Benjamin Grosvenor plays Mozart",
"venue_id": 1
}
Cities
Dataset of cities.
GET
Request:
GET /get-cities
Query Parameters:
- None
Response: 200 OK
{
"country": "United Kingdom",
"id": 1,
"name": "London"
}
Venues
Dataset of concert venues.
GET
Request:
GET /get-venues
Query Parameters:
id: Query by city idname: Query by venue name
Response: 200 OK
{
"city_id": 1,
"id": 1,
"name": "Royal Festival Hall"
}