Edit user
curl --request PUT \
--url https://api.dev.impactu.colav.co/admin/users/{email} \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"role": "<string>"
}
'import requests
url = "https://api.dev.impactu.colav.co/admin/users/{email}"
payload = {
"email": "<string>",
"role": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', role: '<string>'})
};
fetch('https://api.dev.impactu.colav.co/admin/users/{email}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.impactu.colav.co/admin/users/{email}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'role' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dev.impactu.colav.co/admin/users/{email}"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"role\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.dev.impactu.colav.co/admin/users/{email}")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"role\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.impactu.colav.co/admin/users/{email}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"role\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{ "success": true, "msg": "Rol del usuario usuario@example.com actualizado correctamente." }
{
"success": true,
"msg": "Correo del usuario actualizado correctamente y notificación enviada a nuevo@example.com."
}
{ "success": false, "msg": "Debes enviar al menos email o rol." }
{ "success": false, "msg": "No se detectaron cambios para actualizar." }
{ "success": false, "msg": "No se puede asignar el rol 'admin' a un usuario." }
{ "success": false, "msg": "Usuario con correo usuario@example.com no encontrado." }
{ "success": false, "msg": "Ya existe un usuario con el correo nuevo@example.com" }
{"msg": "Token no proporcionado o inválido. Por favor, inicia sesión nuevamente.", "success": false}
{ "success": false, "msg": "No se pudo enviar el correo con las credenciales. No se guardó ningún cambio." }
Users
Edit user
Updates the email address and/or the role of a user. The admin role cannot be assigned and admin accounts cannot be edited.
PUT
/
admin
/
users
/
{email}
Edit user
curl --request PUT \
--url https://api.dev.impactu.colav.co/admin/users/{email} \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"role": "<string>"
}
'import requests
url = "https://api.dev.impactu.colav.co/admin/users/{email}"
payload = {
"email": "<string>",
"role": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', role: '<string>'})
};
fetch('https://api.dev.impactu.colav.co/admin/users/{email}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.impactu.colav.co/admin/users/{email}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'role' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dev.impactu.colav.co/admin/users/{email}"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"role\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.dev.impactu.colav.co/admin/users/{email}")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"role\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.impactu.colav.co/admin/users/{email}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"role\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{ "success": true, "msg": "Rol del usuario usuario@example.com actualizado correctamente." }
{
"success": true,
"msg": "Correo del usuario actualizado correctamente y notificación enviada a nuevo@example.com."
}
{ "success": false, "msg": "Debes enviar al menos email o rol." }
{ "success": false, "msg": "No se detectaron cambios para actualizar." }
{ "success": false, "msg": "No se puede asignar el rol 'admin' a un usuario." }
{ "success": false, "msg": "Usuario con correo usuario@example.com no encontrado." }
{ "success": false, "msg": "Ya existe un usuario con el correo nuevo@example.com" }
{"msg": "Token no proporcionado o inválido. Por favor, inicia sesión nuevamente.", "success": false}
{ "success": false, "msg": "No se pudo enviar el correo con las credenciales. No se guardó ningún cambio." }
Requires an active session with the
admin role. Only active accounts that are not
admin can be edited; otherwise it returns 403.Path parameters
string
required
Current email address of the user to edit.
Request body
At least one of the two fields is mandatory, and both must be text. Any other field returns400.
string
New email address. If another user already uses it, it returns
409.string
New role. It cannot be
admin.Email change
Changing the email generates a new password and sends it to the new email; the old one stops working. The email is sent before the change is saved: if it cannot be sent, it returns502 and the user keeps their email and password.
If only the role changes, no email is sent.
Response
boolean
true if the update succeeded.string
Confirmation or error message.
{ "success": true, "msg": "Rol del usuario usuario@example.com actualizado correctamente." }
{
"success": true,
"msg": "Correo del usuario actualizado correctamente y notificación enviada a nuevo@example.com."
}
{ "success": false, "msg": "Debes enviar al menos email o rol." }
{ "success": false, "msg": "No se detectaron cambios para actualizar." }
{ "success": false, "msg": "No se puede asignar el rol 'admin' a un usuario." }
{ "success": false, "msg": "Usuario con correo usuario@example.com no encontrado." }
{ "success": false, "msg": "Ya existe un usuario con el correo nuevo@example.com" }
{"msg": "Token no proporcionado o inválido. Por favor, inicia sesión nuevamente.", "success": false}
{ "success": false, "msg": "No se pudo enviar el correo con las credenciales. No se guardó ningún cambio." }