Enrolls an existing user into a course. The request body must supply at minimum theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Miguel-Rodriguez15/msvc/llms.txt
Use this file to discover all available pages before exploring further.
id of the user to enroll. The service calls msvc-usuarios via OpenFeign (GET /{id}) to verify the user exists, then creates a CursoUsuario junction record in the cursos_usuarios table linking the user to the specified course.
If the Feign call to msvc-usuarios fails (user not found, service unavailable, etc.) a 404 Not Found response is returned with a descriptive message. The user must already exist in msvc-usuarios before calling this endpoint — to create a new user and enroll them in one step see POST /crear-usuario/{cursoId}.
No authentication is required for this endpoint.
Endpoint
Path Parameters
The primary key of the course into which the user will be enrolled.
Request Body
Content-Type: application/json
The primary key of the user in
msvc-usuarios. The service calls msvc-usuarios using this ID to confirm the user exists before creating the enrollment record.Response
201 Created — TheUsuario object returned by msvc-usuarios for the enrolled user.
Primary key of the user in
msvc-usuarios.Full name of the enrolled user.
Email address of the enrolled user.
Hashed password as stored in
msvc-usuarios.404 Not Found — Returned when the Feign call to
msvc-usuarios throws a FeignException (e.g. the user does not exist or the service is unreachable), or when no course with cursoId exists.
Human-readable error message prefixed with
"No existe el usuario por id o error en la comunicación: " followed by the Feign exception message.Examples
Request
Response — 201 Created
Response — 404 Not Found (user not found in msvc-usuarios)
The
usuarioId stored in the cursos_usuarios junction table is sourced from the id returned by msvc-usuarios, not from the raw value sent in the request body. The Feign round-trip ensures only valid users can be enrolled. Because usuarioId has a unique constraint in the cursos_usuarios table, a user can only be enrolled in one course at a time.