Skip to content

Credentials API ​

Create and manage credentials (assertions) — badges issued to specific recipients.

All endpoints require authentication via the X-Api-Key header. See Authentication.

Create Credential ​

Issue a badge to a recipient.

Need to issue to hundreds or thousands of recipients at once instead of one API call per person? Use the Bulk Credentials UI feature, which accepts a CSV upload.

POST /awards

Parameters ​

ParameterTypeRequiredDescription
badgeIdstringYesThe badge ID to issue
recipientobjectYesRecipient details (see below)
recipient.namestringYesRecipient full name (minimum 5 characters)
recipient.emailstringYesRecipient email address
issuedOnstringYesIssue date in ISO 8601 format (e.g. 2025-01-15)
expiresstringNoExpiration date in ISO 8601 format

Example ​

bash
curl -X POST https://api.badges.ninja/awards \
  -H "X-Api-Key: bws_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "parameters": {
      "badgeId": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
      "recipient": {
        "name": "Jane Smith",
        "email": "jane@example.com"
      },
      "issuedOn": "2025-01-15"
    }
  }'

Response ​

json
{
  "awardId": "https://api.badges.ninja/certify-badge/award/c1d2e3f4-a5b6-7890-cdef-123456789012"
}

Notes ​

  • Counts as one credential against your annual credential pool (Free: 1,200/year, Starter: 12,000/year, Pro: 120,000/year). The pool is a flexible yearly allowance — spend it whenever you like across the year, including in bursts — and resets on your account's registration anniversary. Billing stays monthly; only the credential quota is annual. See Plans & Billing for details.

List Credentials ​

Retrieve credentials with optional filtering and pagination.

GET /awards

Query Parameters ​

ParameterTypeRequiredDescription
filterJSON stringNoFilter object (see below)
lastEvaluatedKeystringNoPagination token from a previous response

Filter Object ​

The filter parameter accepts a JSON string with these fields:

FieldTypeDescription
badgeIdstringFilter by badge ID.
searchstringSubstring to look up in either recipient names or emails (see searchField).
searchFieldstringEither name (default) or email — which column to search.

Pagination via lastEvaluatedKey works with or without filters. Page size is 50.

Example — List All Credentials ​

bash
curl -X GET https://api.badges.ninja/awards \
  -H "X-Api-Key: bws_your_api_key_here"

Example — Filter by Badge ​

bash
curl -X GET "https://api.badges.ninja/awards?filter=%7B%22badgeId%22%3A%22b1c2d3e4%22%7D" \
  -H "X-Api-Key: bws_your_api_key_here"

Response ​

json
{
  "count": 1,
  "items": [
    {
      "id": "https://api.badges.ninja/certify-badge/award/c1d2e3f4-...",
      "badge": {
        "id": "https://api.badges.ninja/certify-badge/badge/b1c2d3e4-...",
        "name": "JavaScript Fundamentals",
        "image": "https://badges.ninja/images/{sha256}.png"
      },
      "recipient": {
        "name": "Jane Smith",
        "email": "jane@example.com"
      },
      "issuedOn": "2025-01-15T00:00:00.000Z",
      "timestamp": "2025-01-15T10:30:00.000Z"
    }
  ],
  "lastEvaluatedKey": "eyJ..."
}

If lastEvaluatedKey is present in the response, there are more results. Pass it as a query parameter in the next request to get the next page.


Send Credential Email ​

Send an email notification to a recipient about their credential.

POST /awards/{awardId}/send

Parameters ​

ParameterTypeRequiredDescription
awardIdstringYesThe award ID (path parameter and body)
emailstringYesRecipient email address

Example ​

bash
curl -X POST https://api.badges.ninja/awards/c1d2e3f4-a5b6-7890-cdef-123456789012/send \
  -H "X-Api-Key: bws_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "parameters": {
      "awardId": "c1d2e3f4-a5b6-7890-cdef-123456789012",
      "email": "jane@example.com"
    }
  }'

Response ​

Returns a plain confirmation string:

json
"email sent"

Share Credential ​

Share a credential with multiple recipients via email.

POST /awards/{awardId}/share

Parameters ​

ParameterTypeRequiredDescription
awardIdstringYesThe award ID (path parameter and body)
recipientsstringYesComma-separated list of email addresses
subjectstringYesEmail subject line
messagestringYesEmail message body

Example ​

bash
curl -X POST https://api.badges.ninja/awards/c1d2e3f4-a5b6-7890-cdef-123456789012/share \
  -H "X-Api-Key: bws_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "parameters": {
      "awardId": "c1d2e3f4-a5b6-7890-cdef-123456789012",
      "recipients": "manager@example.com,hr@example.com",
      "subject": "Check out my new badge!",
      "message": "I just earned the JavaScript Fundamentals badge."
    }
  }'

Response ​

Returns a plain confirmation string:

json
"email sent"

Revoke Credential ​

Revoke a credential you issued. The hosted Open Badges v2.0 assertion is marked revoked: true (with an optional reason) so any verifier sees the badge is no longer valid. The credential record is kept for audit purposes, and no credit is refunded.

Revocation also propagates to the credential's Open Badges 3.0 Verifiable Credential: the award's bit is flipped in the W3C Bitstring Status List referenced by the VC's credentialStatus, so VC wallets detect it too. See Revocation (Bitstring Status List).

POST /awards/{awardId}/revoke

Parameters ​

ParameterTypeRequiredDescription
awardIdstringYesThe award ID (path parameter)
reasonstringNoReason for revocation. Truncated to 500 characters.
notifybooleanNoWhen true, emails the recipient that their credential was revoked. Defaults to false.

Example ​

bash
curl -X POST https://api.badges.ninja/awards/c1d2e3f4-a5b6-7890-cdef-123456789012/revoke \
  -H "X-Api-Key: bws_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "parameters": {
      "awardId": "c1d2e3f4-a5b6-7890-cdef-123456789012",
      "reason": "Issued to the wrong recipient",
      "notify": true
    }
  }'

Response ​

json
{
  "revoked": true,
  "awardId": "c1d2e3f4-a5b6-7890-cdef-123456789012"
}

Revoking an already-revoked credential is idempotent — it returns the same response without re-sending a notification.

Revoke in bulk ​

To revoke many credentials at once, use the durable bulk endpoint with action: "revoke" instead of calling this endpoint per award:

bash
curl -X POST https://api.badges.ninja/awards/bulk-send \
  -H "X-Api-Key: bws_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "parameters": { "action": "revoke", "awardIds": ["<id1>", "<id2>"], "reason": "Program cancelled", "notify": false } }'

It returns { "jobId", "total" }; the job revokes every id server-side (skipping already-revoked ones) and is resumable. Already-revoked and non-existent ids are reported as skipped.


Delete Credential ​

Hard-delete a credential you issued. Unlike revoke, this removes the record entirely and the public credential page will return 404. Use this for genuine mistakes (e.g. issued to the wrong person); prefer revoke for real credentials so the assertion stays verifiable as revoked. No credit is refunded.

DELETE /awards/{awardId}

Parameters ​

ParameterTypeRequiredDescription
awardIdstringYesThe award ID (path parameter)

Example ​

bash
curl -X DELETE https://api.badges.ninja/awards/c1d2e3f4-a5b6-7890-cdef-123456789012 \
  -H "X-Api-Key: bws_your_api_key_here"

Response ​

json
{
  "deleted": true,
  "awardId": "c1d2e3f4-a5b6-7890-cdef-123456789012"
}

Download PDF Certificate ​

Generate a print-ready A4 PDF certificate for a credential.

GET /certify-badge/award/{awardGuid}/pdf

No authentication required — this endpoint is public so recipients can download their own certificate.

Example ​

bash
curl -OJ https://api.badges.ninja/certify-badge/award/c1d2e3f4-a5b6-7890-cdef-123456789012/pdf

The response is the binary PDF with a Content-Type: application/pdf header.


Track Credential Event ​

Record an engagement event. Used by the public credential page to populate engagement stats. No authentication required.

POST /certify-badge/award/{awardGuid}/event

Parameters ​

This endpoint reads its body directly (no parameters wrapper).

ParameterTypeRequiredDescription
eventstringYesOne of view, share, download, click_linkedin_addtoprofile, click_pdf, click_verify.
networkstringNoWhen event=share, the social network: linkedin, twitter, facebook, whatsapp, telegram, email, copy.

Per-IP duplicate suppression: the same event from the same IP is counted once per 24 hours.

Example ​

bash
curl -X POST https://api.badges.ninja/certify-badge/award/c1d2e3f4-a5b6-7890-cdef-123456789012/event \
  -H "Content-Type: application/json" \
  -d '{"event": "share", "network": "linkedin"}'

Response ​

json
{
  "ok": true
}

Get Credential Stats ​

Retrieve cumulative engagement counters for a credential.

GET /certify-badge/award/{awardGuid}/stats

No authentication required.

Response ​

Counters are returned keyed by the raw event type. totals holds the total count per event; networks breaks down the per-network split for events that carry a network (currently share). Events with no recorded activity are simply absent.

json
{
  "totals": {
    "view": 142,
    "share": 16,
    "download": 3,
    "click_linkedin_addtoprofile": 4
  },
  "networks": {
    "share": { "linkedin": 8, "twitter": 2, "email": 1, "copy": 5 }
  }
}

badges.ninja Documentation