Live on Base with Ewance

See the certificates
API ReferenceReferenceBatches

Create a batch of credentials

Submit one or more credentials for signing and anchoring. The endpoint returns immediately; signing + anchoring complete asynchronously, typically within 60 seconds on testnet. Subscribe to `batch.anchored` webhooks rather than polling.

POST
/batches

Authorization

BearerAuth
AuthorizationBearer <token>

Bearer token in the Authorization header. Key prefix determines environment: lrn_test_ → Base Sepolia, lrn_live_ → Base mainnet.

In: header

Header Parameters

Idempotency-Key?string

Arbitrary string (≤ 255 chars, typically a UUID) to deduplicate retries. Same key + same body within 24 h → original response returned. Same key + different body → 409 idempotency_key_reused.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.learncoin.me/v1/batches" \  -H "Idempotency-Key: 6d19f2a4-7c2b-4fcd-b5f1-3ef0a19b82de" \  -H "Content-Type: application/json" \  -d '{    "credentials": [      {        "recipient": {          "id": "urn:uuid:4e0c7f2e-6b1a-4f5a-9c8e-8a1b2c3d4e5f",          "name": "Ada Lovelace",          "email": "[email protected]"        },        "achievement": {          "id": "https://example.edu/credentials/intro-ml",          "name": "Introduction to Machine Learning",          "description": "Completed the 12-week introductory course with distinction.",          "criteria": {            "narrative": "Passing grade on final project plus peer-reviewed submission."          },          "alignment": [            {              "targetFramework": "ESCO",              "targetCode": "S1.4.0",              "targetName": "Machine learning",              "targetUrl": "https://esco.ec.europa.eu/en/classification/skill?uri=http%3A%2F%2Fdata.europa.eu%2Fesco%2Fskill%2FS1.4.0"            }          ]        },        "issuanceDate": "2026-04-23T12:00:00Z"      }    ]  }'
{
  "id": "string",
  "status": "pending",
  "credentials_count": 0,
  "created_at": "2019-08-24T14:15:22Z",
  "anchored_at": "2019-08-24T14:15:22Z",
  "environment": "test",
  "merkle_root": "0x7c2f91a8…",
  "anchor_transaction": {
    "chain": "base-mainnet",
    "hash": "0xabcd…ef12",
    "block_number": 0,
    "explorer_url": "http://example.com"
  },
  "credentials": [
    {
      "id": "string",
      "recipient_id": "string",
      "verify_url": "http://example.com"
    }
  ],
  "error": "string"
}
{
  "error": {
    "code": "credential_not_found",
    "message": "string",
    "request_id": "req_01HXYZABCDEF"
  }
}
{
  "error": {
    "code": "credential_not_found",
    "message": "string",
    "request_id": "req_01HXYZABCDEF"
  }
}
{
  "error": {
    "code": "credential_not_found",
    "message": "string",
    "request_id": "req_01HXYZABCDEF"
  }
}
{
  "error": {
    "code": "credential_not_found",
    "message": "string",
    "request_id": "req_01HXYZABCDEF"
  }
}
{
  "error": {
    "code": "credential_not_found",
    "message": "string",
    "request_id": "req_01HXYZABCDEF"
  }
}