Submit a credential for a person
POST /credentials/submit
Submit a credential document for verification and transformation into a W3C Verifiable Credential. The credential will be processed, signed, and stored according to the OpenBadges 3.0 standard.
The API supports different types of credentials, each with its own metadata structure.
Credential Types
ACIC NCCHC (Australian Criminal Intelligence Commission - Nationally Coordinated Criminal History Check)
- Type:
acicncchc - Description: A nationally coordinated criminal history check certificate
- Metadata Structure: As per NSS result specification
Response
On success, the API returns a reference to the created credential which can be used to retrieve or verify the credential later. The credential is issued as a JWT (JSON Web Token) that can be verified using the TrueVault public key as disclosed in the JWT header iss field.
Security
- Credentials are signed using RSA keys
- File uploads are scanned for malicious content
- All sensitive data is encrypted at rest
Parameters
| Name | In | Required | Description |
|---|---|---|---|
Authorization |
header | yes | Access key generated from the auth API Example: |
Request body
Content type application/json
Fields
| Field | Type | Required | Description |
|---|---|---|---|
type |
string | yes | Type of the credential. Determines the expected metadata structure and validation rules. Supported types:
Note: More credential types will be added in future updates. One of: |
person_ref |
string | yes | Reference to the person in UID format ' |
name |
string | yes | Display name for the credential (not required for type acicncchc) |
description |
string | yes | Description of the credential (not required for type acicncchc) |
metadata |
object | no | The raw credential data specific to the credential type. For type |
file_data |
string | yes | Base64 encoded file data (PNG, JPG, or PDF) for the original document / certificate |
file_name |
string | yes | Name of the source file, with correct extension |
issuer_name |
string | yes | Name of the credential issuer (Your company) |
issuer_url |
string | yes | URL of the credential issuer (Your company website or specific product URL) |
issuer_ref |
string | yes | Reference ID from the issuer (Your company's public ID for this specific credential) |
time_expires |
integer | yes | Unix timestamp when the credential expires (not required for type acicncchc) |
Example request body
{
"type": "acicncchc",
"person_ref": "ab544aa0-e90c-555a-a987-799c0e7f2992/63cf65d5-e5dd-5c64-bad9-158a8b8b3ac0",
"name": "Professional Certification",
"description": "Issued for completion of professional certification",
"file_data": "string",
"file_name": "credential.pdf",
"issuer_name": "TrueVault",
"issuer_url": "https://example.com/issuer",
"issuer_ref": "check-12345",
"time_expires": 1893456000
}
Responses
| Status | Description |
|---|---|
200 OK | Credential submitted successfully |
400 Bad Request | Invalid request parameters |
401 Unauthorized | Unauthorized - Invalid or missing authentication |
409 Conflict | Duplicate credential already exists |
413 Payload Too Large | File too large (max 5MB) |
422 Unprocessable Entity | Validation error |
Content type application/json
Response fields (200)
| Field | Type | Required | Description |
|---|---|---|---|
data |
object | no | The reference for the submitted credential, returned in the |
correlation_id |
string | no |
Example 200 response
{
"data": {
"credential_ref": "0d8f1e2a-6c31-4a51-9f0e-2b7c4d8e1f33/9a8b7c6d-1e2f-4a3b-8c9d-0e1f2a3b4c5d"
},
"correlation_id": "string"
}Content type application/json
Error (400, 409, 413, 422)
| Field | Type | Required | Description |
|---|---|---|---|
error |
object | no | |
error.message |
string | yes | Human-readable error message |
error.code |
string | yes | Machine-readable error code One of: |
error.type |
string | yes | Error type identifier One of: |
error.timestamp |
string | yes | |
error.correlation_id |
string | no | |
error.details |
object | no | Additional error context |
Example 400 response
{
"error": {
"message": "Invalid phone number format",
"code": "E1001",
"type": "VALIDATION_ERROR",
"timestamp": "2024-02-20T03:14:15Z",
"correlation_id": "req_1234567890",
"details": {
"validation_errors": {
"phone": "Must be in format +61423123456"
}
}
}
}
Example request
curl --request POST \
--url https://api.sandbox.truevault.com.au/api/v1/credentials/submit \
--header 'Authorization: <value>' \
--header 'Content-Type: application/json'