curl and a running instance of WebCorporativa API.
Log in to get a token
Send a A successful response returns a JSON object containing your JWT token:
POST request to /api/Auth with your username, password, and a valid Cloudflare Turnstile captcha token.The
captchaToken field must contain a valid token generated by the Cloudflare Turnstile widget on your login page. During local development you can use the Turnstile test secret key, which accepts any token value. See the Cloudflare Turnstile testing docs for test keys.Copy the JWT token
Copy the value of the
token field from the response. You will include this in the Authorization header of every subsequent request.Tokens expire after 30 minutes. When a request returns 401 Unauthorized, repeat step 1 to obtain a new token.Call a protected endpoint
Use the token to call
GET /api/Usuario/mi-perfil, which returns the profile and permissions for the authenticated user.Interpret the response
A successful response contains the authenticated user’s details and their assigned profile:
| Field | Description |
|---|---|
exito | true when the request succeeds. |
data.id | The user’s unique identifier (GUID). |
data.userName | The user’s login username. |
data.nombrePerfil | The display name of the assigned profile. |
data.imagen | Cloudinary URL for the user’s avatar. null if no avatar has been uploaded. |
data.activo | Whether the account is currently active. |
What’s next
Authentication overview
Learn how token expiration, captcha validation, and user registration work.
Profiles and permissions
Understand how profiles and per-module permissions are structured.
Dynamic menu
Use GET /api/Menu to drive navigation from server-side permissions.
API Reference
Full request and response details for every endpoint.