Update Credential
curl --request POST \
--url https://api.thehyperstack.com/v1/credential/{document_id}/update \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"expiry": {}
}'import requests
url = "https://api.thehyperstack.com/v1/credential/{document_id}/update"
payload = { "expiry": {} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({expiry: {}})
};
fetch('https://api.thehyperstack.com/v1/credential/{document_id}/update', 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.thehyperstack.com/v1/credential/{document_id}/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expiry' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.thehyperstack.com/v1/credential/{document_id}/update"
payload := strings.NewReader("{\n \"expiry\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.post("https://api.thehyperstack.com/v1/credential/{document_id}/update")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"expiry\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thehyperstack.com/v1/credential/{document_id}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expiry\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true
}
{
"success": false,
"error": "expiry must be a Unix timestamp in seconds",
"error_code": "invalid_expiry"
}
{
"success": false,
"error": "Document does not exists in your account"
}
{
"detail": "Invalid token or organization not found"
}
Credentials
Update Credential
POST
/
v1
/
credential
/
{document_id}
/
update
Update Credential
curl --request POST \
--url https://api.thehyperstack.com/v1/credential/{document_id}/update \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"expiry": {}
}'import requests
url = "https://api.thehyperstack.com/v1/credential/{document_id}/update"
payload = { "expiry": {} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({expiry: {}})
};
fetch('https://api.thehyperstack.com/v1/credential/{document_id}/update', 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.thehyperstack.com/v1/credential/{document_id}/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expiry' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.thehyperstack.com/v1/credential/{document_id}/update"
payload := strings.NewReader("{\n \"expiry\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.post("https://api.thehyperstack.com/v1/credential/{document_id}/update")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"expiry\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thehyperstack.com/v1/credential/{document_id}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expiry\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true
}
{
"success": false,
"error": "expiry must be a Unix timestamp in seconds",
"error_code": "invalid_expiry"
}
{
"success": false,
"error": "Document does not exists in your account"
}
{
"detail": "Invalid token or organization not found"
}
Description
Sets or removes the expiry date of a credential.Every call sets the expiry. If you leave out
expiry, or send null, the credential’s expiry is removed and it never expires.Headers
string
required
Your API key:
Bearer YOUR_API_KEY. Create a key in the Studio under Settings → Developers.Path Parameters
string
required
ID of the credential.
Body Parameters
number | null
The new expiry date, as a Unix timestamp in seconds (UTC). For example,
1893456000 is 1 January 2030, 00:00 UTC. Send null or leave it out to remove the expiry.Responses
A200 status with "success": true means the change is saved.
{
"success": true
}
{
"success": false,
"error": "expiry must be a Unix timestamp in seconds",
"error_code": "invalid_expiry"
}
{
"success": false,
"error": "Document does not exists in your account"
}
{
"detail": "Invalid token or organization not found"
}
curl -X POST "https://api.thehyperstack.com/v1/credential/6f1c2a8e-3b4d-4e5f-9a7b-1c2d3e4f5a6b/update" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expiry": 1893456000
}'
Last modified on October 20, 2026
Was this page helpful?

