Skip to main content

Add Public Certificate

Uploads and associates a trading partner's public certificate with a communication channel for AS2 signature verification or encryption.

Endpoint

POST /v2/certificates/add-public

Request Body

FieldTypeRequiredConstraintsDescription
commIdintegerYesMust be a valid Comm IDCommunication channel to associate the public certificate with
certTypeCertificateTypeYesSee ENUMsType of certificate (X509, PGP, SSH)
keyIdstringNoKey identifier for the partner's certificate
userIdstringNoUser identifier associated with this certificate
beginUsagedatetimeNoISO 8601Date and time when the certificate becomes active
usageCertificateUsageNoSee ENUMsIntended usage (Encryption, Signature, etc.)
partnerCommIdstringNoPartner's AS2 communication identifier
partnerUrlstringNoValid URLPartner's AS2 endpoint URL
certstringNoBase64-encodedThe partner's public certificate encoded as Base64
{
"commId": 5001,
"certType": "X509",
"keyId": "partner-public-cert-2026",
"userId": "partner-edi",
"beginUsage": "2026-05-07T00:00:00Z",
"usage": "EncryptionAndSignature",
"partnerCommId": "PARTNER-AS2-ID",
"partnerUrl": "https://as2.tradingpartner.com/receive",
"cert": "MIIDXTCCAkWgAwIBAgIJAJC1HiIAZAiIMA0GCSqGSIb3Df..."
}

Response

Returns the updated CommIDInfo object reflecting the newly associated public 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-public" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "commId": 5001, "certType": "X509", "keyId": "partner-public-cert-2026", "userId": "partner-edi", "beginUsage": "2026-05-07T00:00:00Z", "usage": "EncryptionAndSignature", "partnerCommId": "PARTNER-AS2-ID", "partnerUrl": "https://as2.tradingpartner.com/receive", "cert": "MIIDXTCCAkWgAwIBAgIJAJC1HiIAZAiIMA0GCSqGSIb3Df..." }'

See Also