> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer-docs.certifly-seven.com/llms.txt.
> For full documentation content, see https://developer-docs.certifly-seven.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer-docs.certifly-seven.com/_mcp/server.

# Create Certificate

POST http://localhost:8000/api/v1/certificates
Content-Type: application/json

Creates certificate for a template.

Validation (strict):
- `template_id`: required, must exist in tenant DB
- `data`: required object map
- `send_email`: optional boolean
- Keys in `data` must match template labels/extra fields
- Required labels are enforced
- Unknown keys rejected
- String data sanitized

Behavior:
- If `send_email=true`, response includes `meta.email_delivery` with delivery status details.

Scope: `certificates.write`

Reference: https://developer-docs.certifly-seven.com/certifly-seven-gateway-api/certificates/create-certificate

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Certifly Seven Gateway API
  version: 1.0.0
paths:
  /api/v1/certificates:
    post:
      operationId: create-certificate
      summary: Create Certificate
      description: >-
        Creates certificate for a template.


        Validation (strict):

        - `template_id`: required, must exist in tenant DB

        - `data`: required object map

        - `send_email`: optional boolean

        - Keys in `data` must match template labels/extra fields

        - Required labels are enforced

        - Unknown keys rejected

        - String data sanitized


        Behavior:

        - If `send_email=true`, response includes `meta.email_delivery` with
        delivery status details.


        Scope: `certificates.write`
      tags:
        - subpackage_certificates
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Certificates_Create
                  Certificate_Response_201
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1CertificatesRequestUnprocessableEntityError
      requestBody:
        content:
          application/json:
            schema:
              type: string
servers:
  - url: http://localhost:8000
components:
  schemas:
    ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataDataData:
      type: object
      properties:
        Student Name:
          type: string
      required:
        - Student Name
      title: ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataDataData
    ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataDataRoutes:
      type: object
      properties:
        check:
          type: string
          format: uri
        download_pdf:
          type: string
          format: uri
        download_png:
          type: string
          format: uri
      required:
        - check
        - download_pdf
        - download_png
      title: ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataDataRoutes
    ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataData:
      type: object
      properties:
        code:
          type: string
          format: uuid
        data:
          $ref: >-
            #/components/schemas/ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataDataData
        routes:
          $ref: >-
            #/components/schemas/ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataDataRoutes
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        is_rendered:
          type: boolean
        template_id:
          type: string
      required:
        - code
        - data
        - routes
        - created_at
        - updated_at
        - is_rendered
        - template_id
      title: ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataData
    ApiV1CertificatesPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: string
        data:
          $ref: >-
            #/components/schemas/ApiV1CertificatesPostResponsesContentApplicationJsonSchemaDataData
        type:
          type: string
      required:
        - id
        - data
        - type
      title: ApiV1CertificatesPostResponsesContentApplicationJsonSchemaData
    Certificates_Create Certificate_Response_201:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/ApiV1CertificatesPostResponsesContentApplicationJsonSchemaData
        meta:
          type: array
          items:
            description: Any type
      required:
        - data
        - meta
      title: Certificates_Create Certificate_Response_201
    ApiV1CertificatesPostResponsesContentApplicationJsonSchemaErrors:
      type: object
      properties:
        data.Student Name:
          type: array
          items:
            type: string
      required:
        - data.Student Name
      title: ApiV1CertificatesPostResponsesContentApplicationJsonSchemaErrors
    PostApiV1CertificatesRequestUnprocessableEntityError:
      type: object
      properties:
        errors:
          $ref: >-
            #/components/schemas/ApiV1CertificatesPostResponsesContentApplicationJsonSchemaErrors
        message:
          type: string
      required:
        - errors
        - message
      title: PostApiV1CertificatesRequestUnprocessableEntityError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python 201 Created (send_email=true)
import requests

url = "http://localhost:8000/api/v1/certificates"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript 201 Created (send_email=true)
const url = 'http://localhost:8000/api/v1/certificates';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 201 Created (send_email=true)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/api/v1/certificates"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 201 Created (send_email=true)
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/v1/certificates")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java 201 Created (send_email=true)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/certificates")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php 201 Created (send_email=true)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8000/api/v1/certificates', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp 201 Created (send_email=true)
using RestSharp;

var client = new RestClient("http://localhost:8000/api/v1/certificates");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift 201 Created (send_email=true)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/v1/certificates")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python 201 Created (without email send)
import requests

url = "http://localhost:8000/api/v1/certificates"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript 201 Created (without email send)
const url = 'http://localhost:8000/api/v1/certificates';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 201 Created (without email send)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/api/v1/certificates"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 201 Created (without email send)
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/v1/certificates")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java 201 Created (without email send)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/certificates")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php 201 Created (without email send)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8000/api/v1/certificates', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp 201 Created (without email send)
using RestSharp;

var client = new RestClient("http://localhost:8000/api/v1/certificates");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift 201 Created (without email send)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/v1/certificates")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Certificates_Create Certificate_example
import requests

url = "http://localhost:8000/api/v1/certificates"

payload = "{
  \"template_id\": {{template_id}},
  \"send_email\": false,
  \"data\": {
    \"Student Name\": \"John Doe\"
  }
}"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Certificates_Create Certificate_example
const url = 'http://localhost:8000/api/v1/certificates';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '"{\n  \"template_id\": {{template_id}},\n  \"send_email\": false,\n  \"data\": {\n    \"Student Name\": \"John Doe\"\n  }\n}"'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Certificates_Create Certificate_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/api/v1/certificates"

	payload := strings.NewReader("\"{\\n  \\\"template_id\\\": {{template_id}},\\n  \\\"send_email\\\": false,\\n  \\\"data\\\": {\\n    \\\"Student Name\\\": \\\"John Doe\\\"\\n  }\\n}\"")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Certificates_Create Certificate_example
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/v1/certificates")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "\"{\\n  \\\"template_id\\\": {{template_id}},\\n  \\\"send_email\\\": false,\\n  \\\"data\\\": {\\n    \\\"Student Name\\\": \\\"John Doe\\\"\\n  }\\n}\""

response = http.request(request)
puts response.read_body
```

```java Certificates_Create Certificate_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/certificates")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("\"{\\n  \\\"template_id\\\": {{template_id}},\\n  \\\"send_email\\\": false,\\n  \\\"data\\\": {\\n    \\\"Student Name\\\": \\\"John Doe\\\"\\n  }\\n}\"")
  .asString();
```

```php Certificates_Create Certificate_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8000/api/v1/certificates', [
  'body' => '"{\\n  \\"template_id\\": {{template_id}},\\n  \\"send_email\\": false,\\n  \\"data\\": {\\n    \\"Student Name\\": \\"John Doe\\"\\n  }\\n}"',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Certificates_Create Certificate_example
using RestSharp;

var client = new RestClient("http://localhost:8000/api/v1/certificates");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "\"{\\n  \\\"template_id\\\": {{template_id}},\\n  \\\"send_email\\\": false,\\n  \\\"data\\\": {\\n    \\\"Student Name\\\": \\\"John Doe\\\"\\n  }\\n}\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Certificates_Create Certificate_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = "{
  \"template_id\": {{template_id}},
  \"send_email\": false,
  \"data\": {
    \"Student Name\": \"John Doe\"
  }
}" as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/v1/certificates")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```