---
title: "create certificate"
method: POST
path: "/accounts/{account_id}/certificates"
tags: ["Certificates"]
---

# create certificate

`POST /accounts/{account_id}/certificates`

## Request

- Base URL: `https://api.aptible.com`
- URL: `https://api.aptible.com/accounts/{account_id}/certificates`
- Auth: API key in header `Authorization`

Creates a new certificate for the specified account.

## Path parameters

- `account_id` integer, required

## Query parameters

- `no_embed` boolean

## Headers

- `Prefer` 'no_sensitive_extras=true'

## Request body

- CreateCertificateRequest
  - `certificate_body` string, required
  - `private_key` string, required

## Response `201`

successful

- Certificate
  - `id` integer, required
  - `_type` string, required
  - `certificate_body` string, required
  - `private_key` string
  - `common_name` string, required
  - `not_before` string, dateTime, required
  - `not_after` string, dateTime, required
  - `issuer_country` string, required
  - `issuer_organization` string, required
  - `issuer_website` string, required
  - `issuer_common_name` string, required
  - `subject_country` string, required
  - `subject_state` string, required
  - `subject_locale` string, required
  - `subject_organization` string, required
  - `acme` boolean, required
  - `leaf_certificate` string, required
  - `certificate_chain` string, required
  - `sha256_fingerprint` string, required
  - `trusted` boolean, required
  - `self_signed` boolean, required
  - `certificate_arn` string, required
  - `subject_alternative_names` string[], required
  - `private_key_algorithm` string, required
  - `created_at` string, dateTime, required
  - `updated_at` string, dateTime, required
  - `_links` CertificateLinks
    - `account` ListAccountsForStack200ResponseLinksStack
      - `href` string, uri
    - `operations` ListAccountsForStack200ResponseLinksStack
      - `href` string, uri
    - `vhosts` ListAccountsForStack200ResponseLinksStack
      - `href` string, uri
    - `apps` ListAccountsForStack200ResponseLinksStack
      - `href` string, uri
    - `self` ListAccountsForStack200ResponseLinksStack
      - `href` string, uri

## Other responses

- `default`: Error response. Often a 4xx or 5xx status code

## Changes

- **2026-07-24** `1dc1e5b8c6eb`: 1 breaking, 1 warning, 2 info
  - the response property `private_key` became optional for the status `201`
  - removed the request property `acme`
  - added the new optional `header` request parameter `Prefer`
  - added the new optional `query` request parameter `no_embed`

[Operation history](https://skmtc.dev/aptible/apis/aptible-api-v1/changes/accounts/:account_id/certificates/post.md)

---

[API](https://skmtc.dev/aptible/apis/aptible-api-v1.md) - [All operations](https://skmtc.dev/aptible/apis/aptible-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/aptible/apis/aptible-api-v1/revisions/a21f6b1bc6fe?raw)
