Update API key expiration
curl --request PATCH \
--url https://api.dev.impactu.colav.co/users/{email}/apikey \
--header 'Content-Type: application/json' \
--data '{
"expires": 123
}'import requests
url = "https://api.dev.impactu.colav.co/users/{email}/apikey"
payload = { "expires": 123 }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({expires: 123})
};
fetch('https://api.dev.impactu.colav.co/users/{email}/apikey', 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/users/{email}/apikey",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expires' => 123
]),
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/users/{email}/apikey"
payload := strings.NewReader("{\n \"expires\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.dev.impactu.colav.co/users/{email}/apikey")
.header("Content-Type", "application/json")
.body("{\n \"expires\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.impactu.colav.co/users/{email}/apikey")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires\": 123\n}"
response = http.request(request)
puts response.read_body{ "success": true, "msg": "Expiración del API key actualizada" }
{ "success": false, "msg": "La expiración mínima del API key es de 1 día" }
{"msg": "Token no proporcionado o inválido. Por favor, inicia sesión nuevamente.", "success": false}
{ "success": false, "msg": "No tienes permiso para gestionar el API Key de otro usuario." }
{ "success": false, "msg": "Usuario usuario@example.com no encontrado o sin API key" }
Users
Update API key expiration
Updates the expiration date of the user’s existing API key.
PATCH
/
users
/
{email}
/
apikey
Update API key expiration
curl --request PATCH \
--url https://api.dev.impactu.colav.co/users/{email}/apikey \
--header 'Content-Type: application/json' \
--data '{
"expires": 123
}'import requests
url = "https://api.dev.impactu.colav.co/users/{email}/apikey"
payload = { "expires": 123 }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({expires: 123})
};
fetch('https://api.dev.impactu.colav.co/users/{email}/apikey', 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/users/{email}/apikey",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expires' => 123
]),
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/users/{email}/apikey"
payload := strings.NewReader("{\n \"expires\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.dev.impactu.colav.co/users/{email}/apikey")
.header("Content-Type", "application/json")
.body("{\n \"expires\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.impactu.colav.co/users/{email}/apikey")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires\": 123\n}"
response = http.request(request)
puts response.read_body{ "success": true, "msg": "Expiración del API key actualizada" }
{ "success": false, "msg": "La expiración mínima del API key es de 1 día" }
{"msg": "Token no proporcionado o inválido. Por favor, inicia sesión nuevamente.", "success": false}
{ "success": false, "msg": "No tienes permiso para gestionar el API Key de otro usuario." }
{ "success": false, "msg": "Usuario usuario@example.com no encontrado o sin API key" }
The authenticated user can only modify their own API key. If they don’t
have one yet, it returns
404: create it first with
Generate API key.Path parameters
string
required
User’s email address. It must match the authenticated user.
Request body
integer
New expiration date in Unix seconds, as an integer. It must be a
future date at least 1 day ahead. If omitted, the API key has no
expiration.
Response
boolean
true if the expiration was updated successfully.string
Confirmation or error message.
{ "success": true, "msg": "Expiración del API key actualizada" }
{ "success": false, "msg": "La expiración mínima del API key es de 1 día" }
{"msg": "Token no proporcionado o inválido. Por favor, inicia sesión nuevamente.", "success": false}
{ "success": false, "msg": "No tienes permiso para gestionar el API Key de otro usuario." }
{ "success": false, "msg": "Usuario usuario@example.com no encontrado o sin API key" }