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.

This page documents every endpoint exposed by the Users API. Each section covers the method, path, required parameters, expected responses, and a curl example you can run against your own host.

GET /api/vw_user

Returns all user accounts in the database.

Response

200 OK — an array of user objects.
[]
array

Example

cURL
curl --request GET \
  --url https://your-api-host/api/vw_user
200 OK
[
  {
    "Id": 1,
    "Name": "Maria Garcia",
    "Email": "[email protected]",
    "Password": "$2a$11$exampleHashValue...",
    "Role": 1,
    "Status": 1,
    "Created_at": "2024-03-15T10:30:00Z"
  },
  {
    "Id": 2,
    "Name": "Carlos Lopez",
    "Email": "[email protected]",
    "Password": "$2a$11$anotherHashValue...",
    "Role": 2,
    "Status": 1,
    "Created_at": "2024-04-01T08:00:00Z"
  }
]

Error codes

StatusDescription
500 Internal Server ErrorDatabase or unexpected server error.

GET /api/vw_user/{id}

Returns a single user by their numeric ID.

Path parameters

id
integer
required
The numeric ID of the user to retrieve.

Response

200 OK — an array containing the matching user object. 404 Not Found — no user exists with the given ID.
[]
array

Example

cURL
curl --request GET \
  --url https://your-api-host/api/vw_user/1
200 OK
[
  {
    "Id": 1,
    "Name": "Maria Garcia",
    "Email": "[email protected]",
    "Password": "$2a$11$exampleHashValue...",
    "Role": 1,
    "Status": 1,
    "Created_at": "2024-03-15T10:30:00Z"
  }
]
404 Not Found
{
  "message": "ERROR: User not found"
}

Error codes

StatusDescription
404 Not FoundNo user with the given ID exists.
500 Internal Server ErrorDatabase or unexpected server error.

GET /api/vw_user/status/{status}

Returns all users filtered by their account status.

Path parameters

status
integer
required
Account status to filter by. Accepted values:
  • 1 — active users
  • 0 — inactive users

Response

200 OK — an array of user objects matching the requested status. 400 Bad Request — the status value is not 0 or 1.
[]
array

Example

cURL
curl --request GET \
  --url https://your-api-host/api/vw_user/status/1
200 OK — active users
[
  {
    "Id": 1,
    "Name": "Maria Garcia",
    "Email": "[email protected]",
    "Password": "$2a$11$exampleHashValue...",
    "Role": 1,
    "Status": 1,
    "Created_at": "2024-03-15T10:30:00Z"
  }
]
400 Bad Request
{
  "message": "ERROR: The State must be active (1) or inactive (0)"
}

Error codes

StatusDescription
400 Bad Requeststatus is not 0 or 1.
500 Internal Server ErrorDatabase or unexpected server error.

POST /api/vw_user

Creates a new user account. The password you provide is automatically BCrypt-hashed before it is stored.

Request body

Name
string
required
Full name of the new user.
Email
string
required
Email address of the new user. Used for login.
Password
string
required
Plain-text password. The API hashes it with BCrypt before persisting — never send a pre-hashed value to this endpoint.
Role
integer
required
User role: 1 for regular users, 2 for administrators.

Response

200 OK — the user was created successfully.
message
string
Confirmation message: "User inserted successfully."

Example

cURL
curl --request POST \
  --url https://your-api-host/api/vw_user \
  --header 'Content-Type: application/json' \
  --data '{
    "Name": "Ana Torres",
    "Email": "[email protected]",
    "Password": "myplainpassword",
    "Role": 1
  }'
{
  "Name": "Ana Torres",
  "Email": "[email protected]",
  "Password": "myplainpassword",
  "Role": 1
}

Error codes

StatusDescription
500 Internal Server ErrorDatabase constraint violation or unexpected server error.

PUT /api/vw_user/{id}

Updates an existing user by ID. You can modify any combination of fields including the account’s Status.
If the Password value you send already starts with $2a$, the API assumes it is an existing BCrypt hash and stores it without re-hashing. If it does not start with $2a$, the API treats it as a new plain-text password and hashes it before saving.

Path parameters

id
integer
required
The numeric ID of the user to update.

Request body

Name
string
required
Updated full name of the user.
Email
string
required
Updated email address of the user.
Password
string
required
New password (plain text) or existing BCrypt hash. Values starting with $2a$ are stored as-is.
Role
integer
required
Updated role: 1 for regular users, 2 for administrators.
Status
integer
required
Updated account status: 1 = active, 0 = inactive.

Response

200 OK — the user was updated successfully.
message
string
Confirmation message: "User updated successfully."

Example

cURL
curl --request PUT \
  --url https://your-api-host/api/vw_user/1 \
  --header 'Content-Type: application/json' \
  --data '{
    "Name": "Maria Garcia",
    "Email": "[email protected]",
    "Password": "newplainpassword",
    "Role": 1,
    "Status": 1
  }'
{
  "Name": "Maria Garcia",
  "Email": "[email protected]",
  "Password": "newplainpassword",
  "Role": 1,
  "Status": 1
}

Error codes

StatusDescription
500 Internal Server ErrorDatabase or unexpected server error.

DELETE /api/vw_user/{id}

Deletes a user by ID.
This action is permanent. Deleted users cannot be recovered through the API.

Path parameters

id
integer
required
The numeric ID of the user to delete.

Response

200 OK — the user was deleted successfully.

Example

cURL
curl --request DELETE \
  --url https://your-api-host/api/vw_user/1

Error codes

StatusDescription
500 Internal Server ErrorDatabase or unexpected server error.

Build docs developers (and LLMs) love