Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jparra-amell/api_solsql/llms.txt

Use this file to discover all available pages before exploring further.

Departments and cities form the two-level geographic hierarchy that the SolSQL API uses to classify places. Each city belongs to exactly one department via its Department_id field, so you must create a department before you can create a city inside it.

Departments

GET /api/Departments

Returns all departments in the system.
curl -X GET https://your-api-host/api/Departments
Response — 200 OK
[
  { "id": 1, "Name": "Antioquia" },
  { "id": 2, "Name": "Cundinamarca" }
]
id
integer
Unique identifier for the department (department_id column).
Name
string
Display name of the department.

GET /api/Departments/

Returns a single department by its ID.

Path parameters

id
integer
required
The department ID to look up.
curl -X GET https://your-api-host/api/Departments/1
Response — 200 OK
[{ "id": 1, "Name": "Antioquia" }]
Response — 500 Internal Server Error
{ "error": "<database error message>" }

POST /api/Departments

Creates a new department.

Request body

Name
string
required
The name of the new department.
curl -X POST https://your-api-host/api/Departments \
  -H "Content-Type: application/json" \
  -d '{ "Name": "Valle del Cauca" }'
Response — 200 OK
{ "message": "Successfully inserted registration." }

PUT /api/Departments/

Updates an existing department.

Path parameters

id
integer
required
The ID of the department to update.

Request body

Name
string
required
The new name for the department.
curl -X PUT https://your-api-host/api/Departments/1 \
  -H "Content-Type: application/json" \
  -d '{ "Name": "Antioquia Updated" }'
Response — 200 OK
{ "message": "Successfully updated registration." }

DELETE /api/Departments/

Deletes a department by its ID.

Path parameters

id
integer
required
The ID of the department to delete.
curl -X DELETE https://your-api-host/api/Departments/1
Response — 200 OK Returns the number of rows affected.

Cities

GET /api/Cities/{id} filters cities by department ID, not by city ID. It returns all cities that belong to the specified department.

GET /api/Cities

Returns all cities across all departments.
curl -X GET https://your-api-host/api/Cities
Response — 200 OK
[
  {
    "Id": 1,
    "Name_city": "Medellín",
    "Department_id": 1,
    "Name_department": "Antioquia"
  },
  {
    "Id": 2,
    "Name_city": "Bogotá",
    "Department_id": 2,
    "Name_department": "Cundinamarca"
  }
]
Id
integer
Unique identifier for the city (city_id column).
Name_city
string
Display name of the city.
Department_id
integer
ID of the department this city belongs to.
Name_department
string
Display name of the parent department, joined from the departments table.

GET /api/Cities/

Returns all cities that belong to a given department.
Pass a department ID here, not a city ID. To look up a specific city, use GET /api/Cities and filter client-side, or query by department first.

Path parameters

id
integer
required
The department ID whose cities you want to retrieve.
curl -X GET https://your-api-host/api/Cities/1
Response — 200 OK
[
  {
    "Id": 1,
    "Name_city": "Medellín",
    "Department_id": 1,
    "Name_department": "Antioquia"
  }
]

POST /api/Cities

Creates a new city inside an existing department.

Request body

Name_city
string
required
The name of the new city.
Department_id
integer
required
The ID of the department this city belongs to. The department must already exist.
curl -X POST https://your-api-host/api/Cities \
  -H "Content-Type: application/json" \
  -d '{ "Name_city": "Envigado", "Department_id": 1 }'
Response — 200 OK
{ "message": "Successfully inserted registration." }

PUT /api/Cities/

Updates an existing city.

Path parameters

id
integer
required
The ID of the city to update.

Request body

Name_city
string
required
The new name for the city.
Department_id
integer
required
The department ID the city should belong to after the update.
curl -X PUT https://your-api-host/api/Cities/1 \
  -H "Content-Type: application/json" \
  -d '{ "Name_city": "Medellín", "Department_id": 1 }'
Response — 200 OK
{ "message": "Successfully updated registration." }

DELETE /api/Cities/

Deletes a city by its ID.

Path parameters

id
integer
required
The ID of the city to delete.
curl -X DELETE https://your-api-host/api/Cities/1
Response — 200 OK
{ "message": "Successfully deleted registration." }

Error codes

StatusMeaning
200Request succeeded.
500A database or server error occurred. The response body contains an error or message field with details.

Build docs developers (and LLMs) love