Credentials

Endpoints for issuing and retrieving credentials

Issue JSON-LD credentials

post

This endpoint issues JSON-LD credentials.

Authorizations
Query parameters
timeoutnumberOptional

The timeout for the credential issuance (seconds).

Example: 0
Body
invitation_idnumber | nullableOptional

The invitation ID.

Example: 1
contact_idstring | nullableOptional

The contact ID.

revocation_def_idstring | nullableOptional

The ID of status list definition to enable revocation

proofTypestringOptional

The proofType for the credential issuance

Example: Ed25519Signature2020
rulestringOptional

The rule for the credential issuance.

Example: string
Responses
200
JSON-LD credential issued successfully
application/json
post
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"
}
[]

Retrieve a JSON-LD credential by ID

get

This endpoint retrieves a JSON-LD credential by its ID using the provided API key.

Authorizations
Path parameters
idstringRequired

The ID of the credential.

Example: 1
Responses
200
JSON-LD credential retrieved successfully
application/json
get
GET /api/v1/credentials/json-ld/{id} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Accept: */*
{}

Retrieve all credentials

get

This endpoint retrieves all credentials associated with the provided API key.

Authorizations
Responses
200
A list of credentials
application/json
get
GET /api/v1/credentials HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Accept: */*
[]

Issue a new AnonCred credential

post

This endpoint allows you to add a new credential request.

Authorizations
Query parameters
timeoutstringOptional

The timeout for the credential issuance.

Example: 1
Body
invitation_idintegerOptional

The ID of the invitation.

contact_idstringOptional

The ID of the contact.

schema_idstringOptional

The ID of the schema.

rulestringOptional

The rule for the credential issuance.

Responses
200
AnonCred credential issuance record was created
application/json
post
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"
}
[]

Retrieve a credential by its credential definition ID

get

This endpoint retrieves a specific credential by its credential exchange ID.

Authorizations
Path parameters
idstringRequired

The credential exchange ID.

Example: 1
Responses
200
A credential object
application/json
get
GET /api/v1/credentials/{id} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Accept: */*
{}

Retrieve an AnonCred credential record by ID

get

This endpoint retrieves an AnonCred credential record by its ID using the provided API key.

Authorizations
Path parameters
idstringRequired

The ID of the credential record.

Example: 1
Responses
200
Credential record retrieved successfully
application/json
get
GET /api/v1/credential-records/{id} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Accept: */*
{}

Revoke an issued AnonCred credential

post

This endpoint allows you to revoke a credential by providing the connection and credential exchange IDs.

Authorizations
Body
connection_idstringOptional

The connection ID associated with the credential.

credential_exchange_idstringOptional

The credential exchange ID of the credential to revoke.

Responses
200
Credential revocation request accepted or already revoked
application/json
post
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?