Description
This endpoint allows you to create a credential in draft state without immediately publishing it. The credential can be reviewed and published later using the Publish Credential endpoint.
Bearer YOUR_API_TOKEN — obtainable from Hyperstack Dashboard → Settings → API Access
Body Parameters
Information about the recipient of the credential.
Full name of the recipient.
Email address of the recipient.
The unique key of the credential group in which this credential will be generated.
Key-value pairs of custom attributes to embed in the credential. Keys must match the custom fields (prefixed with custom_) configured for your account.
Success Response Fields
Indicates whether the credential was successfully generated.
The unique ID of the newly created draft credential.
URL where the credential will be accessible once published.
Publication status of the credential. Will be "draft" for this endpoint.
Object containing name and email of the recipient.
Object containing title, key, and code of the credential group.
ISO 8601 timestamp of when the credential record was created.
ISO 8601 expiry timestamp. null if the credential does not expire.
Custom attribute values stored with the credential.
Visibility of the credential — "public" or "private".
Responses
200 Success
400 Bad Request
402 Payment Required
404 Not Found
409 Conflict
401 Unauthorized
{
"success" : true ,
"status" : "draft" ,
"document_id" : "j4nDvaxF6ehodPXI84p4X1yhQe7lrYgx" ,
"document_url" : "https://hyperstack.id/credential/j4nDvaxF6ehodPXI84p4X1yhQe7lrYgx" ,
"recipient" : { "name" : "John Doe" , "email" : "[email protected] " },
"group" : { "title" : "Cloud Certification" , "key" : "GcI6H5b66a3v" , "code" : "CC-2024" },
"issued_on" : "2024-03-15T10:30:00Z" ,
"valid_until" : null ,
"metadata" : { "custom_location" : "Mars" },
"privacy" : "public"
}
curl -X POST "https://api.thehyperstack.com/v1/credentials/generate" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"recipient": {
"name": "John Doe",
"email": "[email protected] "
},
"group_key": "GcI6H5b66a3v",
"custom_attributes": {
"custom_location": "Mars"
}
}'