Skip to main content

Add Private Certificate

Uploads and associates a private certificate with a communication channel (Comm) for AS2 or encryption use.

Endpoint

POST /v2/certificates/add-private

Request Body

FieldTypeRequiredConstraintsDescription
commIdintegerYesMust be a valid Comm IDCommunication channel to associate the certificate with
certTypeCertificateTypeYesSee ENUMsType of certificate (X509, PGP, SSH)
keyIdstringNoKey identifier for the certificate
userIdstringNoUser identifier associated with this certificate
beginUsagedatetimeNoISO 8601Date and time when the certificate becomes active
usageCertificateUsageNoSee ENUMsIntended usage (Encryption, Signature, etc.)
certstringNoBase64-encodedThe certificate content encoded as Base64
passwordstringNoPassword protecting the private certificate file
{
"commId": 5001,
"certType": "X509",
"keyId": "my-private-key-2026",
"userId": "edi-system",
"beginUsage": "2026-05-07T00:00:00Z",
"usage": "EncryptionAndSignature",
"cert": "MIIKxAIBAzCCCn4GCSqGSIb3DQEHAaCC...",
"password": "p@ssw0rd!"
}

Response

Returns the updated CommIDInfo object reflecting the newly associated certificate.

{
"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 CertificateType and CertificateUsage ENUMs. See ENUMs Reference for all valid values.

Code Examples

curl -X POST "https://rest.ecgrid.io/v2/certificates/add-private" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "commId": 5001, "certType": "X509", "keyId": "my-private-key-2026", "userId": "edi-system", "beginUsage": "2026-05-07T00:00:00Z", "usage": "EncryptionAndSignature", "cert": "MIIKxAIBAzCCCn4GCSqGSIb3DQEHAaCC...", "password": "p@ssw0rd!" }'

See Also