Workspace API

Certyfikaty

Endpointy „Certyfikaty” Zanfia Workspace API — ze schematami i przykładami kodu.

6 min czytaniaOstatnia aktualizacja: 10 wrz 2026

Certyfikaty ukończenia kursu i szablony, z których są renderowane. Wystawianie jest asynchroniczne: POST /certificates/issue waliduje paczkę, pomija klientów, którzy już mają certyfikat, i kolejkuje jedno zadanie na klienta — render PDF i e-mail z certyfikatem dzieją się w tle, więc odpowiedź to 202 z samymi licznikami. Odpytuj GET /certificates?productId=…, aż pojawi się wiersz klienta. Pojedyncze wystawienie to to samo wywołanie z jednym clientId. Certyfikaty adresowane są publicznym id poświadczenia (cert_…); unieważnienie da się cofnąć przez przywrócenie. Wszystkie endpointy wymagają nagłówka Authorization: Bearer — zobacz Uwierzytelnianie.

Lista certyfikatów

GET/certificates

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Query Parameters

productId?string

Course product id — omit for all courses.

Length1 <= length
limit?integer

Max rows, newest first (max 500; the service default applies when omitted).

Range0 < value <= 500

Response Body

application/json

application/json

curl -X GET "https://example.com/certificates"
{  "certificates": [    {      "id": "string",      "certificateId": "string",      "workspaceId": "string",      "productId": "string",      "courseId": "string",      "clientId": "string",      "recipientName": "string",      "recipientEmail": "string",      "courseName": "string",      "issuerName": "string",      "completionDate": "string",      "issuedAt": "string",      "issuedBy": "manual",      "templateId": "string",      "templateVersion": 0,      "certificateHash": "string",      "pdfStoragePath": "string",      "pdfPublicUrl": "string",      "verificationUrl": "string",      "status": "active",      "revokedAt": "string",      "expiresAt": "string",      "engagement": {        "emailStatus": "submitted",        "emailStatusAt": "string",        "firstViewedAt": "string",        "lastViewedAt": "string",        "viewCount": 0,        "downloadedAt": "string",        "linkedInAddedAt": "string"      }    }  ]}
{  "error": "string",  "message": "string"}

Wystaw certyfikaty (asynchronicznie)

POST/certificates/issue

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/certificates/issue" \  -H "Content-Type: application/json" \  -d '{    "productId": "string",    "clientIds": [      "string"    ]  }'
{  "enqueued": 0,  "skippedExistingCertificate": 0}
{  "error": "string",  "message": "string"}

Lista szablonów certyfikatów

GET/certificates/templates

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/certificates/templates"
{  "templates": [    {      "id": "string",      "workspaceId": "string",      "name": "string",      "version": 0,      "template": {        "basePdf": null,        "schemas": [          null        ]      },      "isDefault": true,      "designConfig": {        "preset": "elegant",        "accentColor": "string",        "typeface": "serif",        "locale": "en",        "wording": {          "title": "string",          "presentedToLabel": "string",          "completedLabel": "string",          "issuedByLabel": "string"        },        "signature": {          "enabled": true,          "name": "string"        },        "elements": {          "logo": true,          "completionDate": true,          "credentialId": true,          "verificationQr": true,          "customText": true        },        "logo": {          "dataUri": "string",          "width": 0,          "height": 0,          "size": "sm"        }      },      "createdAt": "string",      "updatedAt": "string"    }  ]}
{  "error": "string",  "message": "string"}

Utwórz szablon certyfikatu

POST/certificates/templates

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/certificates/templates" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "template": {    "id": "string",    "workspaceId": "string",    "name": "string",    "version": 0,    "template": {      "basePdf": null,      "schemas": [        null      ]    },    "isDefault": true,    "designConfig": {      "preset": "elegant",      "accentColor": "string",      "typeface": "serif",      "locale": "en",      "wording": {        "title": "string",        "presentedToLabel": "string",        "completedLabel": "string",        "issuedByLabel": "string"      },      "signature": {        "enabled": true,        "name": "string"      },      "elements": {        "logo": true,        "completionDate": true,        "credentialId": true,        "verificationQr": true,        "customText": true      },      "logo": {        "dataUri": "string",        "width": 0,        "height": 0,        "size": "sm"      }    },    "createdAt": "string",    "updatedAt": "string"  }}
{  "error": "string",  "message": "string"}

Szczegóły szablonu certyfikatu

GET/certificates/templates/{templateId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

templateId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/certificates/templates/string"
{  "template": {    "id": "string",    "workspaceId": "string",    "name": "string",    "version": 0,    "template": {      "basePdf": null,      "schemas": [        null      ]    },    "isDefault": true,    "designConfig": {      "preset": "elegant",      "accentColor": "string",      "typeface": "serif",      "locale": "en",      "wording": {        "title": "string",        "presentedToLabel": "string",        "completedLabel": "string",        "issuedByLabel": "string"      },      "signature": {        "enabled": true,        "name": "string"      },      "elements": {        "logo": true,        "completionDate": true,        "credentialId": true,        "verificationQr": true,        "customText": true      },      "logo": {        "dataUri": "string",        "width": 0,        "height": 0,        "size": "sm"      }    },    "createdAt": "string",    "updatedAt": "string"  }}
{  "error": "string",  "message": "string"}

Aktualizuj szablon certyfikatu

PATCH/certificates/templates/{templateId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

templateId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/certificates/templates/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "template": {    "id": "string",    "workspaceId": "string",    "name": "string",    "version": 0,    "template": {      "basePdf": null,      "schemas": [        null      ]    },    "isDefault": true,    "designConfig": {      "preset": "elegant",      "accentColor": "string",      "typeface": "serif",      "locale": "en",      "wording": {        "title": "string",        "presentedToLabel": "string",        "completedLabel": "string",        "issuedByLabel": "string"      },      "signature": {        "enabled": true,        "name": "string"      },      "elements": {        "logo": true,        "completionDate": true,        "credentialId": true,        "verificationQr": true,        "customText": true      },      "logo": {        "dataUri": "string",        "width": 0,        "height": 0,        "size": "sm"      }    },    "createdAt": "string",    "updatedAt": "string"  }}
{  "error": "string",  "message": "string"}

Usuń szablon certyfikatu

DELETE/certificates/templates/{templateId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

templateId*string

Response Body

application/json

application/json

curl -X DELETE "https://example.com/certificates/templates/string"
{  "deleted": true}
{  "error": "string",  "message": "string"}

Unieważnij certyfikat

POST/certificates/{certificateId}/revoke

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

certificateId*string

Response Body

application/json

application/json

curl -X POST "https://example.com/certificates/string/revoke"
{  "certificate": {    "id": "string",    "certificateId": "string",    "workspaceId": "string",    "productId": "string",    "courseId": "string",    "clientId": "string",    "recipientName": "string",    "recipientEmail": "string",    "courseName": "string",    "issuerName": "string",    "completionDate": "string",    "issuedAt": "string",    "issuedBy": "manual",    "templateId": "string",    "templateVersion": 0,    "certificateHash": "string",    "pdfStoragePath": "string",    "pdfPublicUrl": "string",    "verificationUrl": "string",    "status": "active",    "revokedAt": "string",    "expiresAt": "string",    "engagement": {      "emailStatus": "submitted",      "emailStatusAt": "string",      "firstViewedAt": "string",      "lastViewedAt": "string",      "viewCount": 0,      "downloadedAt": "string",      "linkedInAddedAt": "string"    }  }}
{  "error": "string",  "message": "string"}

Przywróć certyfikat

POST/certificates/{certificateId}/reinstate

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

certificateId*string

Response Body

application/json

application/json

curl -X POST "https://example.com/certificates/string/reinstate"
{  "certificate": {    "id": "string",    "certificateId": "string",    "workspaceId": "string",    "productId": "string",    "courseId": "string",    "clientId": "string",    "recipientName": "string",    "recipientEmail": "string",    "courseName": "string",    "issuerName": "string",    "completionDate": "string",    "issuedAt": "string",    "issuedBy": "manual",    "templateId": "string",    "templateVersion": 0,    "certificateHash": "string",    "pdfStoragePath": "string",    "pdfPublicUrl": "string",    "verificationUrl": "string",    "status": "active",    "revokedAt": "string",    "expiresAt": "string",    "engagement": {      "emailStatus": "submitted",      "emailStatusAt": "string",      "firstViewedAt": "string",      "lastViewedAt": "string",      "viewCount": 0,      "downloadedAt": "string",      "linkedInAddedAt": "string"    }  }}
{  "error": "string",  "message": "string"}

Usuń unieważniony certyfikat

DELETE/certificates/{certificateId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

certificateId*string

Response Body

application/json

application/json

curl -X DELETE "https://example.com/certificates/string"
{  "deleted": true}
{  "error": "string",  "message": "string"}

Wyślij ponownie e-mail z certyfikatem

POST/certificates/{certificateId}/resend-email

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

certificateId*string

Response Body

application/json

application/json

curl -X POST "https://example.com/certificates/string/resend-email"
{  "property1": null,  "property2": null}
{  "error": "string",  "message": "string"}

Czy ten artykuł był pomocny?

Powiązane artykuły

Coś się nie zgadza? Napisz do nas na support@zanfia.com.