# Certificate Issuance

The **Certificate Issuance API** allows you to issue a new digital certificate to a recipient.

This endpoint creates the certificate, associates it with an organization, and optionally sends an email notification to the recipient.

#### Endpoint

`POST /api/certificates/issue`

#### Description

Use this endpoint to issue a new certificate to a recipient.

You must provide the recipient’s details (name, email, and optional attributes), the organization ID under which the certificate is being issued, and optional email content if you want the certificate delivered via email.

#### Headers

* **`x-api-key`** *(required)* – Your API key from the Akowe dashboard.
* **`x-subaccount-email`** *(optional)* – Used to scope issuance to a particular user’s assets.
* **`Content-Type`**: `application/json`

#### Request Body

| Field            | Type   | Required | Description                                                                                                                                                                                                                                                                                              |
| ---------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `recipientData`  | object | ✅ Yes    | <p>Information about the recipient. Includes <code>name</code>, <code>email</code>, and optional certificate <code>attributes</code>.<br><br>For attributes to work, you need need to create and position fields on your template with the same name as you have specified in the attributes object.</p> |
| `organizationId` | string | ✅ Yes    | The unique ID of the organization issuing the certificate.                                                                                                                                                                                                                                               |
| `mailData`       | object | ✅ Yes    | Email configuration for sending the certificate. Includes `templateId`, `subject`, and `body`.                                                                                                                                                                                                           |

**Example Request**

```bash
curl --location '{{baseurl}}/api/certificates/issue' \
--header &#x27;x-api-key: <your_api_key>&#x27; \
--header 'x-subaccount-email: vendor@example.com' \
--header 'Content-Type: application/json' \
--data-raw '{
  "recipientData": {
    "name": "John Doe",
    "email": "johndoe@mail.com",
    "attributes": {
      "Course Name": "Machine Learning",
      "Grade": "Excellent"
    }
  },
  "organizationId": "ae08808f-85e5-4444-92ca-304a07531f3b",
  "mailData": {
    "templateId": "777e143a-f685-48da-bc8d-39105b8336c0",
    "subject": "Hello",
    "body": "This is a demo credential, congratulations"
  }
}'

```

#### Example Successful Response

```json
{
  "success": true,
  "message": "Certificate issued successfully",
  "data": {
    "certificateId": "c2d9d40d-6f5e-4f3b-8c4b-8d7d2f35f122",
    "recipient": {
      "name": "John Doe",
      "email": "johndoe@mail.com",
    },
    "organizationId": "ae08808f-85e5-4444-92ca-304a07531f3b",
    "issuedAt": "2025-09-24T16:45:10.000Z"
  }
}

```

## POST /certificates/issue

> Issue Single Credential

````json
{"openapi":"3.0.0","info":{"title":"Akowe Issuance API Endpoints","version":"1.0.0"},"tags":[{"name":"Certificate Issuance","description":"The **Certificate Issuance API** allows you to issue a new digital certificate to a recipient.\n\nThis endpoint creates the certificate, associates it with an organization, and optionally sends an email notification to the recipient.\n\n### Endpoint\n\n`POST /api/certificates/issue`\n\n### Description\n\nUse this endpoint to issue a new certificate to a recipient.\n\nYou must provide the recipient’s details (name, email, and optional attributes), the organization ID under which the certificate is being issued, and optional email content if you want the certificate delivered via email.\n\n### Headers\n\n- **`x-api-key`** _(required)_ – Your API key from the Akowe dashboard.\n    \n- **`x-subaccount-email`** _(optional)_ – Used to scope issuance to a particular user’s assets.\n    \n- **`Content-Type`**: `application/json`\n    \n\n### Request Body\n\n| Field | Type | Required | Description |\n| --- | --- | --- | --- |\n| `recipientData` | object | ✅ Yes | Information about the recipient. Includes `name`, `email`, and optional certificate `attributes`.  <br>  <br>For attributes to work, you need need to create and position fields on your template with the same name as you have specified in the attributes object. |\n| `organizationId` | string | ✅ Yes | The unique ID of the organization issuing the certificate. |\n| `mailData` | object | ✅ Yes | Email configuration for sending the certificate. Includes `templateId`, `subject`, and `body`. |\n\n#### Example Request\n\n``` bash\ncurl --location '{{baseurl}}/api/certificates/issue' \\\n--header &#x27;x-api-key: <your_api_key>&#x27; \\\n--header 'x-subaccount-email: vendor@example.com' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n  \"recipientData\": {\n    \"name\": \"John Doe\",\n    \"email\": \"johndoe@mail.com\",\n    \"attributes\": {\n      \"Course Name\": \"Machine Learning\",\n      \"Grade\": \"Excellent\"\n    }\n  },\n  \"organizationId\": \"ae08808f-85e5-4444-92ca-304a07531f3b\",\n  \"mailData\": {\n    \"templateId\": \"777e143a-f685-48da-bc8d-39105b8336c0\",\n    \"subject\": \"Hello\",\n    \"body\": \"This is a demo credential, congratulations\"\n  }\n}'\n\n ```\n\n### Example Successful Response\n\n``` json\n{\n  \"success\": true,\n  \"message\": \"Certificate issued successfully\",\n  \"data\": {\n    \"certificateId\": \"c2d9d40d-6f5e-4f3b-8c4b-8d7d2f35f122\",\n    \"recipient\": {\n      \"name\": \"John Doe\",\n      \"email\": \"johndoe@mail.com\",\n    },\n    \"organizationId\": \"ae08808f-85e5-4444-92ca-304a07531f3b\",\n    \"issuedAt\": \"2025-09-24T16:45:10.000Z\"\n  }\n}\n\n ```"}],"servers":[{"url":"http://{{baseurl}}"}],"paths":{"/certificates/issue":{"post":{"tags":["Certificate Issuance"],"summary":"Issue Single Credential","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"parameters":[{"name":"x-api-key","in":"header","schema":{"type":"string"}},{"name":"x-subaccount-email","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
````
