---
title: "Dry run of an upload: parsed certificate, blocking problems, warnings and the hostnames it would serve. Nothing is stored"
method: POST
path: "/certificates/validate"
tags: ["Certificates"]
---

# Dry run of an upload: parsed certificate, blocking problems, warnings and the hostnames it would serve. Nothing is stored

`POST /certificates/validate`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/certificates/validate`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Query parameters

- `orgId` string: Organization id (required when you belong to several)

## Request body

- object
  - `certificatePem` string, required: PEM certificate; may also contain the chain after the leaf
  - `chainPem` string: intermediate certificate(s), PEM
  - `privateKeyPem` string, required: unencrypted PEM private key (PKCS#8, PKCS#1 or SEC1); stored encrypted, never shown again

## Response `200`

Result

- object
  - `valid` boolean, required
  - `problems` object[], required: blocking
    - `code` string, required
    - `message` string, required
  - `warnings` object[], required
    - `code` string, required
    - `message` string, required
  - `certificate` object, nullable, required
    - `names` string[], required
    - `commonName` string, nullable, required
    - `issuer` string, required
    - `notBefore` string, required: ISO-8601 timestamp
    - `notAfter` string, required: ISO-8601 timestamp
    - `daysLeft` integer, required
    - `keyType` string, required
    - `keyBits` integer, required
    - `fingerprint` string, required
    - `trusted` boolean, required
    - `chainLength` integer, required
  - `covers` object[], required: your verified domains this certificate would be served for
    - `hostname` string, required
    - `projectId` string, uuid, nullable, required
    - `projectName` string, nullable, required

## Other responses

- `400`: Invalid request (code invalid_request); details.problems lists every certificate problem
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict)
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Not available on this server (code not_configured)
- `503`: Certificate provider unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
