Publish Credential
curl --request POST \
--url https://api.thehyperstack.com/v1/credential/{document_id}/publishimport requests
url = "https://api.thehyperstack.com/v1/credential/{document_id}/publish"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.thehyperstack.com/v1/credential/{document_id}/publish', 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}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.thehyperstack.com/v1/credential/{document_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
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}/publish")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thehyperstack.com/v1/credential/{document_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Credential published successfully"
}
{
"success": false,
"error": "Credential is not in draft status",
"error_code": "invalid_status"
}
{
"success": false,
"error": "Document does not exists in your account"
}
{
"detail": "Invalid token or organization not found"
}
Credentials
Publish Credential
POST
/
v1
/
credential
/
{document_id}
/
publish
Publish Credential
curl --request POST \
--url https://api.thehyperstack.com/v1/credential/{document_id}/publishimport requests
url = "https://api.thehyperstack.com/v1/credential/{document_id}/publish"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.thehyperstack.com/v1/credential/{document_id}/publish', 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}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.thehyperstack.com/v1/credential/{document_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
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}/publish")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thehyperstack.com/v1/credential/{document_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Credential published successfully"
}
{
"success": false,
"error": "Credential is not in draft status",
"error_code": "invalid_status"
}
{
"success": false,
"error": "Document does not exists in your account"
}
{
"detail": "Invalid token or organization not found"
}
Description
This endpoint allows you to publish a credential that is currently in draft state. This is used in conjunction with the Generate Credential endpoint, which creates credentials without immediately publishing them.Headers
string
required
Bearer YOUR_API_TOKEN — obtainable from Hyperstack Dashboard → Settings → API Access
Path Parameters
string
required
The unique ID (key) of the draft credential to publish.
Success Response Fields
boolean
Indicates whether the credential was successfully queued for publishing.
string
A confirmation message. Value:
"Credential published successfully".Responses
{
"success": true,
"message": "Credential published successfully"
}
{
"success": false,
"error": "Credential is not in draft status",
"error_code": "invalid_status"
}
{
"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/j4nDvaxF6ehodPXI84p4X1yhQe7lrYgx/publish" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Last modified on February 22, 2026
Was this page helpful?
⌘I

