Skip to main content

Create Certificate

Generates a new private certificate for a communication channel, creating the key pair on the ECGrid platform.

Endpoint

POST /v2/certificates/create

Request Body

FieldTypeRequiredConstraintsDescription
commIdintegerYesMust be a valid Comm IDCommunication channel to associate the new certificate with
beginUsagedatetimeNoISO 8601Date and time when the certificate becomes active
usageCertificateUsageNoSee ENUMsIntended usage (Encryption, Signature, or EncryptionAndSignature)
secureHashAlgorithmCertificateSecureHashAlgorithmNoSee ENUMsHashing algorithm for the certificate (SHA1, SHA256, SHA384, SHA512)
partnerAs2IdstringNoPartner's AS2 identifier to embed in the certificate
expiresdatetimeNoISO 8601Certificate expiration date
{
"commId": 5001,
"beginUsage": "2026-05-07T00:00:00Z",
"usage": "EncryptionAndSignature",
"secureHashAlgorithm": "SHA256",
"partnerAs2Id": "PARTNER-AS2-ID",
"expires": "2028-05-07T00:00:00Z"
}

Response

Returns the CommIDInfo object with the newly generated certificate details.

{
"success": true,
"data": {
"commId": 5001,
"mailboxId": 101,
"commType": "as2",
"identifier": "MYCOMPANY-AS2",
"status": "Active",
"useType": "Production",
"privateKeyRequired": true,
"withCerts": true
}
}

ENUMs

This endpoint uses the CertificateUsage and CertificateSecureHashAlgorithm ENUMs. See ENUMs Reference for all valid values.

CertificateSecureHashAlgorithm

ValueDescription
SHA1SHA-1 hashing — established, not recommended for new certificates
SHA256SHA-256 hashing — recommended minimum for new certificates
SHA384SHA-384 hashing
SHA512SHA-512 hashing — strongest available option

Code Examples

curl -X POST "https://rest.ecgrid.io/v2/certificates/create" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "commId": 5001, "beginUsage": "2026-05-07T00:00:00Z", "usage": "EncryptionAndSignature", "secureHashAlgorithm": "SHA256", "partnerAs2Id": "PARTNER-AS2-ID", "expires": "2028-05-07T00:00:00Z" }'

See Also