Credentials
Endpoints for issuing and retrieving credentials
This endpoint issues JSON-LD credentials.
The timeout for the credential issuance (seconds).
0
The invitation ID.
1
The contact ID.
The ID of status list definition to enable revocation
The proofType for the credential issuance
Ed25519Signature2020
The rule for the credential issuance.
string
JSON-LD credential issued successfully
Bad Request
Unauthorized.
Unprocessable Entity.
Internal Server Error
POST /api/v1/credentials/json-ld HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1251
{
"invitation_id": 1,
"contact_id": "",
"revocation_def_id": "",
"credential": {
"@context": [
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
"https://www.w3.org/ns/credentials/status/v1"
],
"issuanceDate": "2024-11-29T21:07:11Z",
"validFrom": "2024-11-29T11:34:20Z",
"awardedDate": "2024-11-29T21:07:11Z",
"expirationDate": "2025-11-29T11:34:20Z",
"validUntil": "2025-11-29T11:34:20Z",
"type": [
"OpenBadgeCredential"
],
"description": "Awesome Credential Description",
"name": "New Awesome JSON-LD Credential",
"issuer": {
"id": "did:indy:<namespace>:5uF3EGLPkBccqMhEfX2JS8",
"type": [
"Profile"
],
"name": "Awesome Issuer Name",
"description": "An awesome Issuer who Issues awesome credentials.",
"url": "https://www.awesome-issuer-url.com",
"email": "[email protected]",
"image": {
"id": "https://www.awesome-issuer-url.com/images/issuer-logo.png",
"type": "Image",
"caption": "Awesome Issuer Logo"
}
},
"credentialSubject": {
"type": [
"AchievementSubject"
],
"achievement": {
"id": "https://example.org/achievements/degree",
"name": "Your name",
"description": "Your description",
"criteria": {
"type": "Criteria",
"narrative": "Your narrative"
},
"image": {
"id": "https://example.org/achievements/image.png",
"type": "Image"
},
"type": [
"Achievement"
]
}
}
},
"proofType": "Ed25519Signature2020",
"rule": "string"
}
[]
This endpoint retrieves a JSON-LD credential by its ID using the provided API key.
The ID of the credential.
1
JSON-LD credential retrieved successfully
Unauthorized.
JSON-LD credential record not found
Internal Server Error
GET /api/v1/credentials/json-ld/{id} HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Accept: */*
{}
This endpoint retrieves all credentials associated with the provided API key.
A list of credentials
Unauthorized.
Internal Server Error
GET /api/v1/credentials HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Accept: */*
[]
This endpoint allows you to add a new credential request.
The timeout for the credential issuance.
1
The ID of the invitation.
The ID of the contact.
The ID of the schema.
The rule for the credential issuance.
AnonCred credential issuance record was created
Bad Request
Unauthorized.
Unprocessable Entity.
Internal Server Error
POST /api/v1/credentials HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 285
{
"invitation_id": 1,
"contact_id": "",
"schema_id": "KT4LtL7HEMePqQSyKVof7g:2:Email:1.0",
"attributes": [
{
"name": "local_part",
"value": "timmy"
},
{
"name": "domain",
"value": "example.com"
},
{
"name": "address",
"value": "[email protected]"
},
{
"name": "verified_at",
"value": "1670296277"
}
],
"rule": "no rule"
}
[]
This endpoint retrieves a specific credential by its credential exchange ID.
The credential exchange ID.
1
A credential object
Unauthorized.
Credential record not found
Internal Server Error
GET /api/v1/credentials/{id} HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Accept: */*
{}
This endpoint retrieves an AnonCred credential record by its ID using the provided API key.
The ID of the credential record.
1
Credential record retrieved successfully
Unauthorized.
AnonCred credential record not found
Internal Server Error
GET /api/v1/credential-records/{id} HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Accept: */*
{}
This endpoint allows you to revoke a credential by providing the connection and credential exchange IDs.
The connection ID associated with the credential.
The credential exchange ID of the credential to revoke.
Credential revocation request accepted or already revoked
Bad Request
Unauthorized
Unprocessable Entity
Internal Server Error
POST /api/v1/credentials/anoncreds/revoke HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 99
{
"connection_id": "example-connection_id",
"credential_exchange_id": "example-credential_exchange_id"
}
{
"message": "Revocation request processed successfully."
}
Was this helpful?