Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Create an SSO Certificate



API Overview

api-overview page anchor

The Single Sign-On APIs allow you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the Twilio SendGrid App(link takes you to an external page).

The Certificates API allows you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the public_certificate and integration_id parameters.

For more information about managing SSO Certificates, see the Twilio SendGrid SSO documentation.


POST/v3/sso/certificates

Base url: https://api.sendgrid.com

This endpoint allows you to create an SSO certificate.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
SchemaExample
Property nameTypeRequiredDescriptionChild properties
public_certificatestringrequired

This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes.


enabledbooleanOptional

Indicates if the certificate is enabled.


integration_idstringrequired

An ID that matches a certificate to a specific IdP integration. This is the id returned by the "Get All SSO Integrations" endpoint.

200400401403429500
SchemaExample
Property nameTypeRequiredDescriptionChild properties
public_certificatestring

This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta. This is called the X509 certificate in the Twilio SendGrid UI.


idnumber

A unique ID assigned to the certificate by SendGrid.


not_beforenumber

A unix timestamp (e.g., 1603915954) that indicates the time before which the certificate is not valid.


not_afternumber

A unix timestamp (e.g., 1603915954) that indicates the time after which the certificate is no longer valid.


intergration_idstring

An ID that matches a certificate to a specific IdP integration.

Create an SSO Certificate

create-an-sso-certificate page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_23
const client = require('@sendgrid/client');
_23
client.setApiKey(process.env.SENDGRID_API_KEY);
_23
_23
const data = {
_23
"public_certificate": "<your x509 certificate>",
_23
"enabled": false,
_23
"integration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312"
_23
};
_23
_23
const request = {
_23
url: `/v3/sso/certificates`,
_23
method: 'POST',
_23
body: data
_23
}
_23
_23
client.request(request)
_23
.then(([response, body]) => {
_23
console.log(response.statusCode);
_23
console.log(response.body);
_23
})
_23
.catch(error => {
_23
console.error(error);
_23
});


Rate this page: