Skip to content
bynhDocs

Add a certificate

POST/workspaces/{workspace}/certificates

Adds a certificate. Its status follows the expiry date; send in_audit: true for one still being audited. Nothing appears on your trust center until you publish it.

Authentication

Send an API token as a bearer token. This endpoint needs a read and write token, made by an editor, admin or owner. Create one in My account → API tokens; see scopes and roles.

Authorization: Bearer 42|bynh_pat_•••••••Header

Path parameters

  • workspacestringRequired

    Your workspace slug, e.g. dokan.

Request body

application/json
  • namestringRequiredmax 120

    The standard. Error: “Enter the standard, like ISO/IEC 27001:2022.”

  • issuerstringRequiredmax 120

    Who issued it. Error: “Enter who issued it, like BSI Group.”

  • descriptionstring, nullablemax 160

    Short line under the name.

  • certificate_numberstring, nullablemax 64

    Number on the certificate.

  • issued_onstring, nullableYYYY-MM-DD

    On or before today.

  • valid_untilstring, nullableRequiredYYYY-MM-DD

    Required unless in_audit is true. On or after issued_on.

  • scopestring, nullablemax 2000

    Scope statement.

  • in_auditboolean

    true marks it in audit; false returns it to date-derived status.

  • notestring, nullablemax 120

    Short note.

  • show_badgeboolean

    Show a badge on the trust center.

  • allow_downloadboolean

    Let visitors download it.

  • share_soa_after_ndaboolean

    Share the SoA after an NDA.

  • publishboolean

    true publishes it (sets published_at if not already), false unpublishes. Compared with === true, so send a JSON boolean, not "1".

Response

201 Created

The new certificate with documents (an empty array).

  • idintegerCertificate id.
  • namestringThe standard, e.g. ISO/IEC 27001:2022.
  • descriptionstring|nullShort line under the name.
  • issuerstringWho issued it.
  • certificate_numberstring|nullThe number on the certificate.
  • statusenumDerived from valid_until on every save: expired after the date, renewing within 30 days of it, otherwise valid. in_audit is the only status you set (with in_audit: true). One of valid, renewing, in_audit, expired.
  • issued_onstring|nullYYYY-MM-DD.
  • valid_untilstring|nullYYYY-MM-DD.
  • days_leftinteger|nullDays from today to valid_until; negative once expired.
  • scopestring|nullScope statement.
  • notestring|nullShort note.
  • show_badgebooleanShow a badge on the trust center.
  • allow_downloadbooleanLet visitors download the certificate.
  • share_soa_after_ndabooleanShare the Statement of Applicability after an NDA.
  • publishedbooleanShown on the trust center.
  • documentsarray<Document>Present on show, create and update only (omitted from the list). Newest first on show.

Rate limits

This endpoint counts toward your general limit of 120 requests a minute. When you go over, wait for the number of seconds in Retry-After.

Errors

401The token is missing, wrong, revoked or expired.
403The token is read-only (message: “This token is read-only. Create a read and write token to make changes.”). Or: The token’s owner is a viewer (“Viewers can read everything but can’t change it.”), or the workspace’s editing is paused (a billing message, e.g. “Your trial has ended, so editing is paused. …”).
404The token belongs to another workspace, or its owner is no longer a member.
422Validation fails. Messages: “Enter the standard, like ISO/IEC 27001:2022.”, “Enter who issued it, like BSI Group.”, “The issue date can’t be in the future.”, “The expiry date must be after the issue date.”, “Enter the expiry date, or mark it as in audit.”, “Enter a date as YYYY-MM-DD.”

Every error is JSON with a message. See Errors.

Next →Get a certificate
curl -X POST "https://api.bynh.io/api/v1/workspaces/dokan/certificates" \
  -H "Authorization: Bearer $BYNH_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SOC 2 Type II",
    "issuer": "A-LIGN",
    "issued_on": "2026-08-31",
    "valid_until": "2027-08-30",
    "show_badge": true,
    "share_soa_after_nda": true,
    "publish": false
  }'

Response201 Created

application/json
{
  "data": {
    "id": 11,
    "name": "SOC 2 Type II",
    "description": null,
    "issuer": "A-LIGN",
    "certificate_number": null,
    "status": "valid",
    "issued_on": "2026-08-31",
    "valid_until": "2027-08-30",
    "days_left": 333,
    "scope": null,
    "note": null,
    "show_badge": true,
    "allow_download": false,
    "share_soa_after_nda": true,
    "published": false,
    "documents": []
  }
}

Examples use Dokan, a sample workspace. Responses are shortened where lists are long.