Skip to contentSkip to navigationSkip to topbar
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 (for global users and subusers)

Base url: https://api.eu.sendgrid.com (for EU regional subusers)

This endpoint allows you to create an SSO certificate.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Encoding type:application/json
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 CertificateLink to code sample: Create an SSO Certificate
1
const client = require('@sendgrid/client');
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const data = {
5
"public_certificate": "<your x509 certificate>",
6
"enabled": false,
7
"integration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312"
8
};
9
10
const request = {
11
url: `/v3/sso/certificates`,
12
method: 'POST',
13
body: data
14
}
15
16
client.request(request)
17
.then(([response, body]) => {
18
console.log(response.statusCode);
19
console.log(response.body);
20
})
21
.catch(error => {
22
console.error(error);
23
});

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.