Skip to main content
Base URL: http://localhost:3001/api/v1

POST /proyecto

Create a new project.
Requires authentication. Admin or Project Manager.
Request body
nombre
string
required
Project name.
descripcion
string
required
Project description.
The project owner (owner_id) is automatically set to the authenticated user. You do not need to supply it.
Example request
curl -X POST http://localhost:3001/api/v1/proyecto \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Website Redesign",
    "descripcion": "Full redesign of the marketing site."
  }'
Example response201 Created
{
  "success": true,
  "message": "Project created.",
  "data": {
    "id_proyecto": 12,
    "nombre": "Website Redesign",
    "descripcion": "Full redesign of the marketing site."
  }
}

GET /proyecto

Returns all projects.
Requires authentication. Admin only.
Example request
curl http://localhost:3001/api/v1/proyecto \
  -H "Authorization: Bearer <accessToken>"
Example response200 OK
{
  "success": true,
  "message": "Projects retrieved.",
  "data": [
    { "id_proyecto": 12, "nombre": "Website Redesign", "archivado": false },
    { "id_proyecto": 13, "nombre": "Mobile App", "archivado": false }
  ]
}

GET /proyecto/pm

Returns projects owned by the authenticated Project Manager.
Requires authentication. Project Manager only.
Example request
curl http://localhost:3001/api/v1/proyecto/pm \
  -H "Authorization: Bearer <accessToken>"
Example response200 OK
{
  "success": true,
  "message": "Projects retrieved.",
  "data": [
    { "id_proyecto": 12, "nombre": "Website Redesign", "archivado": false }
  ]
}

PUT /proyecto

Archive a project by ID.
Requires authentication. Admin only.
Request body
id_proyecto
integer
required
ID of the project to archive.
Example request
curl -X PUT http://localhost:3001/api/v1/proyecto \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{ "id_proyecto": 12 }'
Example response200 OK
{
  "success": true,
  "message": "Project archived.",
  "data": { "id_proyecto": 12, "archivado": true }
}

PUT /proyecto/pm

Archive one of the authenticated PM’s own projects.
Requires authentication. Project Manager only.
Request body
id_proyecto
integer
required
ID of the project to archive.
Example request
curl -X PUT http://localhost:3001/api/v1/proyecto/pm \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{ "id_proyecto": 12 }'
Example response200 OK
{
  "success": true,
  "message": "Project archived.",
  "data": { "id_proyecto": 12, "archivado": true }
}

PUT /proyecto/editar

Edit a project’s name or description.
Requires authentication. Admin or Project Manager.
Request body
id_proyecto
integer
required
ID of the project to edit.
nombre
string
New project name.
descripcion
string
New project description.
Example request
curl -X PUT http://localhost:3001/api/v1/proyecto/editar \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{ "id_proyecto": 12, "nombre": "Site Overhaul", "descripcion": "Updated scope." }'
Example response200 OK
{
  "success": true,
  "message": "Project updated.",
  "data": { "id_proyecto": 12, "nombre": "Site Overhaul", "descripcion": "Updated scope." }
}

DELETE /proyecto

Permanently delete a project and all of its tasks.
This action is irreversible. All tasks belonging to the project are also deleted.
Requires authentication. Admin only.
Request body
id_proyecto
integer
required
ID of the project to delete.
Example request
curl -X DELETE http://localhost:3001/api/v1/proyecto \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{ "id_proyecto": 12 }'
Example response200 OK
{
  "success": true,
  "message": "Project and all associated tasks deleted.",
  "data": { "id_proyecto": 12 }
}

Build docs developers (and LLMs) love