// This file is auto-generated by @hey-api/openapi-ts import { createClient, createConfig, type Options } from '@hey-api/client-fetch'; import type { GetAccessSettingsActivityData, GetAccessSettingsActivityError, GetAccessSettingsActivityResponse, DeleteAccessSettingsWhitelistData, DeleteAccessSettingsWhitelistError, DeleteAccessSettingsWhitelistResponse, GetAccessSettingsWhitelistData, GetAccessSettingsWhitelistError, GetAccessSettingsWhitelistResponse, PostAccessSettingsWhitelistData, PostAccessSettingsWhitelistError, PostAccessSettingsWhitelistResponse, DeleteAccessSettingsWhitelistRuleIdData, DeleteAccessSettingsWhitelistRuleIdError, DeleteAccessSettingsWhitelistRuleIdResponse, GetAccessSettingsWhitelistRuleIdData, GetAccessSettingsWhitelistRuleIdError, GetAccessSettingsWhitelistRuleIdResponse, GetAlertsData, GetAlertsError, GetAlertsResponse, PostAlertsData, PostAlertsError, PostAlertsResponse, DeleteAlertsAlertIdData, DeleteAlertsAlertIdError, DeleteAlertsAlertIdResponse, GetAlertsAlertIdData, GetAlertsAlertIdError, GetAlertsAlertIdResponse, PatchAlertsAlertIdData, PatchAlertsAlertIdError, PatchAlertsAlertIdResponse, GetApiKeysData, GetApiKeysError, GetApiKeysResponse, CreateApiKeysData, CreateApiKeysError, CreateApiKeysResponse, DeleteApiKeysApiKeyIdData, DeleteApiKeysApiKeyIdError, DeleteApiKeysApiKeyIdResponse, GetApiKeysApiKeyIdData, GetApiKeysApiKeyIdError, GetApiKeysApiKeyIdResponse, PatchApiKeysApiKeyIdData, PatchApiKeysApiKeyIdError, PatchApiKeysApiKeyIdResponse, PutApiKeysApiKeyIdData, PutApiKeysApiKeyIdError, PutApiKeysApiKeyIdResponse, GetAsmGroupsData, GetAsmGroupsError, GetAsmGroupsResponse, PostAsmGroupsData, PostAsmGroupsError, PostAsmGroupsResponse, DeleteAsmGroupsGroupIdData, DeleteAsmGroupsGroupIdError, DeleteAsmGroupsGroupIdResponse, GetAsmGroupsGroupIdData, GetAsmGroupsGroupIdError, GetAsmGroupsGroupIdResponse, PatchAsmGroupsGroupIdData, PatchAsmGroupsGroupIdError, PatchAsmGroupsGroupIdResponse, GetAsmGroupsGroupIdSuppressionsData, GetAsmGroupsGroupIdSuppressionsError, GetAsmGroupsGroupIdSuppressionsResponse, PostAsmGroupsGroupIdSuppressionsData, PostAsmGroupsGroupIdSuppressionsError, PostAsmGroupsGroupIdSuppressionsResponse, PostAsmGroupsGroupIdSuppressionsSearchData, PostAsmGroupsGroupIdSuppressionsSearchError, PostAsmGroupsGroupIdSuppressionsSearchResponse, DeleteAsmGroupsGroupIdSuppressionsEmailData, DeleteAsmGroupsGroupIdSuppressionsEmailError, DeleteAsmGroupsGroupIdSuppressionsEmailResponse, GetAsmSuppressionsData, GetAsmSuppressionsError, GetAsmSuppressionsResponse, PostAsmSuppressionsGlobalData, PostAsmSuppressionsGlobalError, PostAsmSuppressionsGlobalResponse, DeleteAsmSuppressionsGlobalEmailData, DeleteAsmSuppressionsGlobalEmailError, DeleteAsmSuppressionsGlobalEmailResponse, GetAsmSuppressionsGlobalEmailData, GetAsmSuppressionsGlobalEmailError, GetAsmSuppressionsGlobalEmailResponse, GetAsmSuppressionsEmailData, GetAsmSuppressionsEmailError, GetAsmSuppressionsEmailResponse, GetBrowsersStatsData, GetBrowsersStatsError, GetBrowsersStatsResponse, GetCampaignsData, GetCampaignsError, GetCampaignsResponse, PostCampaignsData, PostCampaignsError, PostCampaignsResponse, DeleteCampaignsCampaignIdData, DeleteCampaignsCampaignIdError, DeleteCampaignsCampaignIdResponse, GetCampaignsCampaignIdData, GetCampaignsCampaignIdError, GetCampaignsCampaignIdResponse, PatchCampaignsCampaignIdData, PatchCampaignsCampaignIdError, PatchCampaignsCampaignIdResponse, DeleteCampaignsCampaignIdSchedulesData, DeleteCampaignsCampaignIdSchedulesError, DeleteCampaignsCampaignIdSchedulesResponse, GetCampaignsCampaignIdSchedulesData, GetCampaignsCampaignIdSchedulesError, GetCampaignsCampaignIdSchedulesResponse, PatchCampaignsCampaignIdSchedulesData, PatchCampaignsCampaignIdSchedulesError, PatchCampaignsCampaignIdSchedulesResponse, PostCampaignsCampaignIdSchedulesData, PostCampaignsCampaignIdSchedulesError, PostCampaignsCampaignIdSchedulesResponse, PostCampaignsCampaignIdSchedulesNowData, PostCampaignsCampaignIdSchedulesNowError, PostCampaignsCampaignIdSchedulesNowResponse, PostCampaignsCampaignIdSchedulesTestData, PostCampaignsCampaignIdSchedulesTestError, PostCampaignsCampaignIdSchedulesTestResponse, GetCategoriesData, GetCategoriesError, GetCategoriesResponse, GetCategoriesStatsData, GetCategoriesStatsError, GetCategoriesStatsResponse, GetCategoriesStatsSumsData, GetCategoriesStatsSumsError, GetCategoriesStatsSumsResponse, GetClientsStatsData, GetClientsStatsError, GetClientsStatsResponse, GetClientsClientTypeStatsData, GetClientsClientTypeStatsError, GetClientsClientTypeStatsResponse, GetContactdbCustomFieldsData, GetContactdbCustomFieldsError, GetContactdbCustomFieldsResponse, PostContactdbCustomFieldsData, PostContactdbCustomFieldsError, PostContactdbCustomFieldsResponse, DeleteContactdbCustomFieldsCustomFieldIdData, DeleteContactdbCustomFieldsCustomFieldIdError, DeleteContactdbCustomFieldsCustomFieldIdResponse, GetContactdbCustomFieldsCustomFieldIdData, GetContactdbCustomFieldsCustomFieldIdError, GetContactdbCustomFieldsCustomFieldIdResponse, DeleteContactdbListsData, DeleteContactdbListsError, DeleteContactdbListsResponse, GetContactdbListsData, GetContactdbListsError, GetContactdbListsResponse, PostContactdbListsData, PostContactdbListsError, PostContactdbListsResponse, DeleteContactdbListsListIdData, DeleteContactdbListsListIdError, DeleteContactdbListsListIdResponse, GetContactdbListsListIdData, GetContactdbListsListIdError, GetContactdbListsListIdResponse, PatchContactdbListsListIdData, PatchContactdbListsListIdError, PatchContactdbListsListIdResponse, GetContactdbListsListIdRecipientsData, GetContactdbListsListIdRecipientsError, GetContactdbListsListIdRecipientsResponse, PostContactdbListsListIdRecipientsData, PostContactdbListsListIdRecipientsError, PostContactdbListsListIdRecipientsResponse, DeleteContactdbListsListIdRecipientsRecipientIdData, DeleteContactdbListsListIdRecipientsRecipientIdError, DeleteContactdbListsListIdRecipientsRecipientIdResponse, PostContactdbListsListIdRecipientsRecipientIdData, PostContactdbListsListIdRecipientsRecipientIdError, PostContactdbListsListIdRecipientsRecipientIdResponse, DeleteContactdbRecipientsData, DeleteContactdbRecipientsError, DeleteContactdbRecipientsResponse, GetContactdbRecipientsData, GetContactdbRecipientsError, GetContactdbRecipientsResponse, PatchContactdbRecipientsData, PatchContactdbRecipientsError, PatchContactdbRecipientsResponse, PostContactdbRecipientsData, PostContactdbRecipientsError, PostContactdbRecipientsResponse, GetContactdbRecipientsBillableCountData, GetContactdbRecipientsBillableCountError, GetContactdbRecipientsBillableCountResponse, GetContactdbRecipientsCountData, GetContactdbRecipientsCountError, GetContactdbRecipientsCountResponse, GetContactdbRecipientsSearchData, GetContactdbRecipientsSearchError, GetContactdbRecipientsSearchResponse, PostContactdbRecipientsSearchData, PostContactdbRecipientsSearchError, PostContactdbRecipientsSearchResponse, DeleteContactdbRecipientsRecipientIdData, DeleteContactdbRecipientsRecipientIdError, DeleteContactdbRecipientsRecipientIdResponse, GetContactdbRecipientsRecipientIdData, GetContactdbRecipientsRecipientIdError, GetContactdbRecipientsRecipientIdResponse, GetContactdbRecipientsRecipientIdListsData, GetContactdbRecipientsRecipientIdListsError, GetContactdbRecipientsRecipientIdListsResponse, GetContactdbReservedFieldsData, GetContactdbReservedFieldsError, GetContactdbReservedFieldsResponse, GetContactdbSegmentsData, GetContactdbSegmentsError, GetContactdbSegmentsResponse, PostContactdbSegmentsData, PostContactdbSegmentsError, PostContactdbSegmentsResponse, DeleteContactdbSegmentsSegmentIdData, DeleteContactdbSegmentsSegmentIdError, DeleteContactdbSegmentsSegmentIdResponse, GetContactdbSegmentsSegmentIdData, GetContactdbSegmentsSegmentIdError, GetContactdbSegmentsSegmentIdResponse, PatchContactdbSegmentsSegmentIdData, PatchContactdbSegmentsSegmentIdError, PatchContactdbSegmentsSegmentIdResponse, GetContactdbSegmentsSegmentIdRecipientsData, GetContactdbSegmentsSegmentIdRecipientsError, GetContactdbSegmentsSegmentIdRecipientsResponse, GetContactdbStatusData, GetContactdbStatusError, GetContactdbStatusResponse, ListDesignsData, ListDesignsError, ListDesignsResponse, PostDesignsData, PostDesignsError, PostDesignsResponse, ListSendgridPreBuiltDesignsData, ListSendgridPreBuiltDesignsError, ListSendgridPreBuiltDesignsResponse, GetSendgridPreBuiltDesignData, GetSendgridPreBuiltDesignError, GetSendgridPreBuiltDesignResponse, PostSendgridPreBuiltDesignData, PostSendgridPreBuiltDesignError, PostSendgridPreBuiltDesignResponse, DeleteDesignData, DeleteDesignError, DeleteDesignResponse, GetDesignData, GetDesignError, GetDesignResponse, PutDesignData, PutDesignError, PutDesignResponse, PostDesignData, PostDesignError, PostDesignResponse, GetDevicesStatsData, GetDevicesStatsError, GetDevicesStatsResponse, GetGeoStatsData, GetGeoStatsError, GetGeoStatsResponse, GetIpsData, GetIpsError, GetIpsResponse, PostIpsData, PostIpsError, PostIpsResponse, GetIpsAssignedError, GetIpsAssignedResponse, GetIpsPoolsError, GetIpsPoolsResponse, PostIpsPoolsData, PostIpsPoolsError, PostIpsPoolsResponse, DeleteIpsPoolsPoolNameData, DeleteIpsPoolsPoolNameError, DeleteIpsPoolsPoolNameResponse, GetIpsPoolsPoolNameData, GetIpsPoolsPoolNameError, GetIpsPoolsPoolNameResponse, PutIpsPoolsPoolNameData, PutIpsPoolsPoolNameError, PutIpsPoolsPoolNameResponse, PostIpsPoolsPoolNameIpsData, PostIpsPoolsPoolNameIpsError, PostIpsPoolsPoolNameIpsResponse, DeleteIpsPoolsPoolNameIpsIpData, DeleteIpsPoolsPoolNameIpsIpError, DeleteIpsPoolsPoolNameIpsIpResponse, GetIpsRemainingError, GetIpsRemainingResponse, GetIpsWarmupError, GetIpsWarmupResponse, PostIpsWarmupData, PostIpsWarmupError, PostIpsWarmupResponse, DeleteIpsWarmupIpAddressData, DeleteIpsWarmupIpAddressError, DeleteIpsWarmupIpAddressResponse, GetIpsWarmupIpAddressData, GetIpsWarmupIpAddressError, GetIpsWarmupIpAddressResponse, GetIpsIpAddressData, GetIpsIpAddressError, GetIpsIpAddressResponse, PostMailBatchData, PostMailBatchError, PostMailBatchResponse, GetMailBatchBatchIdData, GetMailBatchBatchIdError, GetMailBatchBatchIdResponse, PostMailSendData, PostMailSendError, PostMailSendResponse, GetMailSettingsData, GetMailSettingsError, GetMailSettingsResponse, GetMailSettingsAddressWhitelistData, GetMailSettingsAddressWhitelistError, GetMailSettingsAddressWhitelistResponse, PatchMailSettingsAddressWhitelistData, PatchMailSettingsAddressWhitelistError, PatchMailSettingsAddressWhitelistResponse, GetMailSettingsBouncePurgeData, GetMailSettingsBouncePurgeError, GetMailSettingsBouncePurgeResponse, PatchMailSettingsBouncePurgeData, PatchMailSettingsBouncePurgeError, PatchMailSettingsBouncePurgeResponse, GetMailSettingsFooterData, GetMailSettingsFooterError, GetMailSettingsFooterResponse, PatchMailSettingsFooterData, PatchMailSettingsFooterError, PatchMailSettingsFooterResponse, GetMailSettingsForwardBounceData, GetMailSettingsForwardBounceError, GetMailSettingsForwardBounceResponse, PatchMailSettingsForwardBounceData, PatchMailSettingsForwardBounceError, PatchMailSettingsForwardBounceResponse, GetMailSettingsForwardSpamData, GetMailSettingsForwardSpamError, GetMailSettingsForwardSpamResponse, PatchMailSettingsForwardSpamData, PatchMailSettingsForwardSpamError, PatchMailSettingsForwardSpamResponse, GetMailSettingsTemplateData, GetMailSettingsTemplateError, GetMailSettingsTemplateResponse, PatchMailSettingsTemplateData, PatchMailSettingsTemplateError, PatchMailSettingsTemplateResponse, GetMailboxProvidersStatsData, GetMailboxProvidersStatsError, GetMailboxProvidersStatsResponse, DeleteMcContactsData, DeleteMcContactsError, DeleteMcContactsResponse, GetMcContatsError, GetMcContatsResponse, PutMcContactsData, PutMcContactsError, PutMcContactsResponse, PostMarketingContactsBatchData, PostMarketingContactsBatchError, PostMarketingContactsBatchResponse, GetMcContactsCountError, GetMcContactsCountResponse, GetMarketingContactsExportsError, GetMarketingContactsExportsResponse, PostMcContactsExportsData, PostMcContactsExportsError, PostMcContactsExportsResponse, GetMcContactsExportsIdData, GetMcContactsExportsIdError, GetMcContactsExportsIdResponse, PutMcContactsImportsData, PutMcContactsImportsError, PutMcContactsImportsResponse, GetMarketingContactsImportsIdData, GetMarketingContactsImportsIdError, GetMarketingContactsImportsIdResponse, PostMcContactsSearchData, PostMcContactsSearchError, PostMcContactsSearchResponse, PostMarketingContactsSearchEmailsData, PostMarketingContactsSearchEmailsError, PostMarketingContactsSearchEmailsResponse, GetMcContactsIdData, GetMcContactsIdError, GetMcContactsIdResponse, GetMcFieldDefinitionsError, GetMcFieldDefinitionsResponse, PostMcFieldDefinitionsData, PostMcFieldDefinitionsError, PostMcFieldDefinitionsResponse, DeleteMcFieldDefinitionsCustomFieldIdData, DeleteMcFieldDefinitionsCustomFieldIdError, DeleteMcFieldDefinitionsCustomFieldIdResponse, PatchMcFieldDefinitionsCustomFieldIdData, PatchMcFieldDefinitionsCustomFieldIdError, PatchMcFieldDefinitionsCustomFieldIdResponse, GetMcListsData, GetMcListsError, GetMcListsResponse, PostMcListsData, PostMcListsError, PostMcListsResponse, DeleteListsIdData, DeleteListsIdError, DeleteListsIdResponse, GetMcListsIdData, GetMcListsIdError, GetMcListsIdResponse, PatchMcListsIdData, PatchMcListsIdError, PatchMcListsIdResponse, DeleteMcListsIdContactsData, DeleteMcListsIdContactsError, DeleteMcListsIdContactsResponse, GetMcListsIdContactsCountData, GetMcListsIdContactsCountError, GetMcListsIdContactsCountResponse, GetMarketingSegmentsData, GetMarketingSegmentsError, GetMarketingSegmentsResponse, PostMarketingSegmentsData, PostMarketingSegmentsError, PostMarketingSegmentsResponse, GetSegmentsData, GetSegmentsError, GetSegmentsResponse, PostSegmentsData, PostSegmentsError, PostSegmentsResponse, DeleteSegmentsSegmentIdData, DeleteSegmentsSegmentIdError, DeleteSegmentsSegmentIdResponse, GetSegmentsSegmentIdData, GetSegmentsSegmentIdError, GetSegmentsSegmentIdResponse, PatchSegmentsSegmentIdData, PatchSegmentsSegmentIdError, PatchSegmentsSegmentIdResponse, PostMarketingSegmentsDeleteData, PostMarketingSegmentsDeleteError, PostMarketingSegmentsDeleteResponse, DeleteMarketingSegmentsSegmentIdData, DeleteMarketingSegmentsSegmentIdError, DeleteMarketingSegmentsSegmentIdResponse, GetMarketingSegmentsSegmentIdData, GetMarketingSegmentsSegmentIdError, GetMarketingSegmentsSegmentIdResponse, PatchMarketingSegmentsSegmentIdData, PatchMarketingSegmentsSegmentIdError, PatchMarketingSegmentsSegmentIdResponse, PostMarketingSendersData, PostMarketingSendersError, PostMarketingSendersResponse, DeleteMarketingSinglesendsData, DeleteMarketingSinglesendsError, DeleteMarketingSinglesendsResponse, GetMarketingSinglesendsData, GetMarketingSinglesendsError, GetMarketingSinglesendsResponse, PostMarketingSinglesendsData, PostMarketingSinglesendsError, PostMarketingSinglesendsResponse, GetMarketingSinglesendsCategoriesError, GetMarketingSinglesendsCategoriesResponse, PostMarketingSinglesendsSearchData, PostMarketingSinglesendsSearchError, PostMarketingSinglesendsSearchResponse, DeleteMarketingSinglesendsIdData, DeleteMarketingSinglesendsIdError, DeleteMarketingSinglesendsIdResponse, GetMarketingSinglesendsIdData, GetMarketingSinglesendsIdError, GetMarketingSinglesendsIdResponse, PatchMarketingSinglesendsIdData, PatchMarketingSinglesendsIdError, PatchMarketingSinglesendsIdResponse, PostMarketingSinglesendsIdData, PostMarketingSinglesendsIdError, PostMarketingSinglesendsIdResponse, DeleteMarketingSinglesendsIdScheduleData, DeleteMarketingSinglesendsIdScheduleError, DeleteMarketingSinglesendsIdScheduleResponse, PutMarketingSinglesendsIdScheduleData, PutMarketingSinglesendsIdScheduleError, PutMarketingSinglesendsIdScheduleResponse, GetallAutomationStatsData, GetallAutomationStatsError, GetallAutomationStatsResponse, GetAutomationsStatsExportData, GetAutomationsStatsExportError, GetAutomationsStatsExportResponse, GetAutomationStatData, GetAutomationStatError, GetAutomationStatResponse, GetAutomationLinkStatData, GetAutomationLinkStatError, GetAutomationLinkStatResponse, GetallSinglesendStatsData, GetallSinglesendStatsError, GetallSinglesendStatsResponse, GetSinglesendStatsExportData, GetSinglesendStatsExportError, GetSinglesendStatsExportResponse, GetSinglesendStatData, GetSinglesendStatError, GetSinglesendStatResponse, GetSinglesendLinkStatData, GetSinglesendLinkStatError, GetSinglesendLinkStatResponse, PostMarketingTestSendEmailData, PostMarketingTestSendEmailError, PostMarketingTestSendEmailResponse, GetMessagesData, GetMessagesError, GetMessagesResponse, PostV3MessagesDownloadData, PostV3MessagesDownloadError, PostV3MessagesDownloadResponse, GetV3MessagesDownloadDownloadUuidData, GetV3MessagesDownloadDownloadUuidError, GetV3MessagesDownloadDownloadUuidResponse, GetV3MessagesMsgIdData, GetV3MessagesMsgIdError, GetV3MessagesMsgIdResponse, GetPartnerSettingsData, GetPartnerSettingsError, GetPartnerSettingsResponse, GetPartnerSettingsNewRelicData, GetPartnerSettingsNewRelicError, GetPartnerSettingsNewRelicResponse, PatchPartnerSettingsNewRelicData, PatchPartnerSettingsNewRelicError, PatchPartnerSettingsNewRelicResponse, GetScopesData, GetScopesError, GetScopesResponse, GetV3ScopesRequestsData, GetV3ScopesRequestsError, GetV3ScopesRequestsResponse, DeleteV3ScopesRequestsRequestIdData, DeleteV3ScopesRequestsRequestIdError, DeleteV3ScopesRequestsRequestIdResponse, PatchV3ScopesRequestsApproveIdData, PatchV3ScopesRequestsApproveIdError, PatchV3ScopesRequestsApproveIdResponse, GetV3SendersData, GetV3SendersError, GetV3SendersResponse, PostSendersData, PostSendersError, PostSendersResponse, DeleteV3SendersSenderIdData, DeleteV3SendersSenderIdError, DeleteV3SendersSenderIdResponse, GetV3SendersSenderIdData, GetV3SendersSenderIdError, GetV3SendersSenderIdResponse, PatchV3SendersSenderIdData, PatchV3SendersSenderIdError, PatchV3SendersSenderIdResponse, PostV3SendersSenderIdResendVerificationData, PostV3SendersSenderIdResendVerificationError, PostV3SendersSenderIdResendVerificationResponse, PostSsoCertificatesData, PostSsoCertificatesError, PostSsoCertificatesResponse, DeleteSsoCertificatesCertIdData, DeleteSsoCertificatesCertIdError, DeleteSsoCertificatesCertIdResponse, GetSsoCertificatesCertIdData, GetSsoCertificatesCertIdError, GetSsoCertificatesCertIdResponse, PatchSsoCertificatesCertIdData, GetSsoIntegrationsData, GetSsoIntegrationsError, GetSsoIntegrationsResponse, PostSsoIntegrationsData, PostSsoIntegrationsError, PostSsoIntegrationsResponse, DeleteSsoIntegrationsIdData, DeleteSsoIntegrationsIdError, DeleteSsoIntegrationsIdResponse, GetSsoIntegrationsIdData, GetSsoIntegrationsIdError, GetSsoIntegrationsIdResponse, PatchSsoIntegrationsIdData, PatchSsoIntegrationsIdError, PatchSsoIntegrationsIdResponse, GetSsoIntegrationsIntegrationIdCertificatesData, GetSsoIntegrationsIntegrationIdCertificatesError, GetSsoIntegrationsIntegrationIdCertificatesResponse, PostSsoTeammatesData, PostSsoTeammatesError, PostSsoTeammatesResponse, PatchSsoTeammatesUsernameData, PatchSsoTeammatesUsernameError, PatchSsoTeammatesUsernameResponse, GetStatsData, GetStatsError, GetStatsResponse, GetSubusersData, GetSubusersError, GetSubusersResponse, PostSubusersData, PostSubusersError, PostSubusersResponse, GetSubusersReputationsData, GetSubusersReputationsError, GetSubusersReputationsResponse, GetSubusersStatsData, GetSubusersStatsError, GetSubusersStatsResponse, GetSubusersStatsMonthlyData, GetSubusersStatsMonthlyError, GetSubusersStatsMonthlyResponse, GetSubusersStatsSumsData, GetSubusersStatsSumsError, GetSubusersStatsSumsResponse, DeleteSubusersSubuserNameData, DeleteSubusersSubuserNameError, DeleteSubusersSubuserNameResponse, PatchSubusersSubuserNameData, PatchSubusersSubuserNameError, PatchSubusersSubuserNameResponse, PutSubusersSubuserNameIpsData, PutSubusersSubuserNameIpsError, PutSubusersSubuserNameIpsResponse, DeleteSubusersSubuserNameMonitorData, DeleteSubusersSubuserNameMonitorError, DeleteSubusersSubuserNameMonitorResponse, GetSubusersSubuserNameMonitorData, GetSubusersSubuserNameMonitorError, GetSubusersSubuserNameMonitorResponse, PostSubusersSubuserNameMonitorData, PostSubusersSubuserNameMonitorError, PostSubusersSubuserNameMonitorResponse, PutSubusersSubuserNameMonitorData, PutSubusersSubuserNameMonitorError, PutSubusersSubuserNameMonitorResponse, GetSubusersSubuserNameStatsMonthlyData, GetSubusersSubuserNameStatsMonthlyError, GetSubusersSubuserNameStatsMonthlyResponse, DeleteSuppressionBlocksData, DeleteSuppressionBlocksError, DeleteSuppressionBlocksResponse, GetSuppressionBlocksData, GetSuppressionBlocksError, GetSuppressionBlocksResponse, DeleteSuppressionBlocksEmailData, DeleteSuppressionBlocksEmailError, DeleteSuppressionBlocksEmailResponse, GetSuppressionBlocksEmailData, GetSuppressionBlocksEmailError, GetSuppressionBlocksEmailResponse, DeleteSuppressionBouncesData, DeleteSuppressionBouncesError, DeleteSuppressionBouncesResponse, GetSuppressionBouncesData, GetSuppressionBouncesError, GetSuppressionBouncesResponse, DeleteSuppressionBouncesEmailData, DeleteSuppressionBouncesEmailError, DeleteSuppressionBouncesEmailResponse, GetSuppressionBouncesEmailData, GetSuppressionBouncesEmailError, GetSuppressionBouncesEmailResponse, DeleteSuppressionInvalidEmailsData, DeleteSuppressionInvalidEmailsError, DeleteSuppressionInvalidEmailsResponse, GetSuppressionInvalidEmailsData, GetSuppressionInvalidEmailsError, GetSuppressionInvalidEmailsResponse, DeleteSuppressionInvalidEmailsEmailData, DeleteSuppressionInvalidEmailsEmailError, DeleteSuppressionInvalidEmailsEmailResponse, GetSuppressionInvalidEmailsEmailData, GetSuppressionInvalidEmailsEmailError, GetSuppressionInvalidEmailsEmailResponse, DeleteSuppressionSpamReportsData, DeleteSuppressionSpamReportsError, DeleteSuppressionSpamReportsResponse, GetSuppressionSpamReportsData, GetSuppressionSpamReportsError, GetSuppressionSpamReportsResponse, DeleteSuppressionSpamReportsEmailData, DeleteSuppressionSpamReportsEmailError, DeleteSuppressionSpamReportsEmailResponse, GetSuppressionSpamReportsEmailData, GetSuppressionSpamReportsEmailError, GetSuppressionSpamReportsEmailResponse, GetSuppressionUnsubscribesData, GetSuppressionUnsubscribesError, GetSuppressionUnsubscribesResponse, GetV3TeammatesData, GetV3TeammatesError, GetV3TeammatesResponse, PostV3TeammatesData, PostV3TeammatesError, PostV3TeammatesResponse, GetV3TeammatesPendingData, GetV3TeammatesPendingError, GetV3TeammatesPendingResponse, DeleteV3TeammatesPendingTokenData, DeleteV3TeammatesPendingTokenError, DeleteV3TeammatesPendingTokenResponse, PostV3TeammatesPendingTokenResendData, PostV3TeammatesPendingTokenResendError, PostV3TeammatesPendingTokenResendResponse, DeleteV3TeammatesUsernameData, DeleteV3TeammatesUsernameError, DeleteV3TeammatesUsernameResponse, GetV3TeammatesUsernameData, GetV3TeammatesUsernameError, GetV3TeammatesUsernameResponse, PatchV3TeammatesUsernameData, PatchV3TeammatesUsernameError, PatchV3TeammatesUsernameResponse, GetTemplatesData, GetTemplatesError, GetTemplatesResponse, PostTemplatesData, PostTemplatesError, PostTemplatesResponse, DeleteTemplatesTemplateIdData, DeleteTemplatesTemplateIdError, DeleteTemplatesTemplateIdResponse, GetTemplatesTemplateIdData, GetTemplatesTemplateIdError, GetTemplatesTemplateIdResponse, PatchTemplatesTemplateIdData, PatchTemplatesTemplateIdError, PatchTemplatesTemplateIdResponse, PostTemplatesTemplateIdData, PostTemplatesTemplateIdError, PostTemplatesTemplateIdResponse, PostTemplatesTemplateIdVersionsData, PostTemplatesTemplateIdVersionsError, PostTemplatesTemplateIdVersionsResponse, DeleteTemplatesTemplateIdVersionsVersionIdData, DeleteTemplatesTemplateIdVersionsVersionIdError, DeleteTemplatesTemplateIdVersionsVersionIdResponse, GetTemplatesTemplateIdVersionsVersionIdData, GetTemplatesTemplateIdVersionsVersionIdError, GetTemplatesTemplateIdVersionsVersionIdResponse, PatchTemplatesTemplateIdVersionsVersionIdData, PatchTemplatesTemplateIdVersionsVersionIdError, PatchTemplatesTemplateIdVersionsVersionIdResponse, PostTemplatesTemplateIdVersionsVersionIdActivateData, PostTemplatesTemplateIdVersionsVersionIdActivateError, PostTemplatesTemplateIdVersionsVersionIdActivateResponse, GetTrackingSettingsData, GetTrackingSettingsError, GetTrackingSettingsResponse, GetTrackingSettingsClickData, GetTrackingSettingsClickError, GetTrackingSettingsClickResponse, PatchTrackingSettingsClickData, PatchTrackingSettingsClickError, PatchTrackingSettingsClickResponse, GetTrackingSettingsGoogleAnalyticsData, GetTrackingSettingsGoogleAnalyticsError, GetTrackingSettingsGoogleAnalyticsResponse, PatchTrackingSettingsGoogleAnalyticsData, PatchTrackingSettingsGoogleAnalyticsError, PatchTrackingSettingsGoogleAnalyticsResponse, GetTrackingSettingsOpenData, GetTrackingSettingsOpenError, GetTrackingSettingsOpenResponse, PatchTrackingSettingsOpenData, PatchTrackingSettingsOpenError, PatchTrackingSettingsOpenResponse, GetTrackingSettingsSubscriptionData, GetTrackingSettingsSubscriptionError, GetTrackingSettingsSubscriptionResponse, PatchTrackingSettingsSubscriptionData, PatchTrackingSettingsSubscriptionError, PatchTrackingSettingsSubscriptionResponse, GetUserAccountData, GetUserAccountError, GetUserAccountResponse, GetUserCreditsData, GetUserCreditsError, GetUserCreditsResponse, GetUserEmailData, GetUserEmailError, GetUserEmailResponse, PutUserEmailData, PutUserEmailError, PutUserEmailResponse, PutUserPasswordData, PutUserPasswordError, PutUserPasswordResponse, GetUserProfileData, GetUserProfileError, GetUserProfileResponse, PatchUserProfileData, PatchUserProfileError, PatchUserProfileResponse, GetUserScheduledSendsData, GetUserScheduledSendsError, GetUserScheduledSendsResponse, PostUserScheduledSendsData, PostUserScheduledSendsError, PostUserScheduledSendsResponse, DeleteUserScheduledSendsBatchIdData, DeleteUserScheduledSendsBatchIdError, DeleteUserScheduledSendsBatchIdResponse, GetUserScheduledSendsBatchIdData, GetUserScheduledSendsBatchIdError, GetUserScheduledSendsBatchIdResponse, PatchUserScheduledSendsBatchIdData, PatchUserScheduledSendsBatchIdError, PatchUserScheduledSendsBatchIdResponse, GetUserSettingsEnforcedTlsData, GetUserSettingsEnforcedTlsError, GetUserSettingsEnforcedTlsResponse, PatchUserSettingsEnforcedTlsData, PatchUserSettingsEnforcedTlsError, PatchUserSettingsEnforcedTlsResponse, GetUserUsernameData, GetUserUsernameError, GetUserUsernameResponse, PutUserUsernameData, PutUserUsernameError, PutUserUsernameResponse, GetUserWebhooksEventSettingsData, GetUserWebhooksEventSettingsError, GetUserWebhooksEventSettingsResponse, PatchUserWebhooksEventSettingsData, PatchUserWebhooksEventSettingsError, PatchUserWebhooksEventSettingsResponse, GetUserWebhooksEventSettingsSignedData, GetUserWebhooksEventSettingsSignedError, GetUserWebhooksEventSettingsSignedResponse, PatchUserWebhooksEventSettingsSignedData, PatchUserWebhooksEventSettingsSignedError, PatchUserWebhooksEventSettingsSignedResponse, PostUserWebhooksEventTestData, PostUserWebhooksEventTestError, PostUserWebhooksEventTestResponse, GetUserWebhooksParseSettingsData, GetUserWebhooksParseSettingsError, GetUserWebhooksParseSettingsResponse, PostUserWebhooksParseSettingsData, PostUserWebhooksParseSettingsError, PostUserWebhooksParseSettingsResponse, DeleteUserWebhooksParseSettingsHostnameData, DeleteUserWebhooksParseSettingsHostnameError, DeleteUserWebhooksParseSettingsHostnameResponse, GetUserWebhooksParseSettingsHostnameData, GetUserWebhooksParseSettingsHostnameError, GetUserWebhooksParseSettingsHostnameResponse, PatchUserWebhooksParseSettingsHostnameData, PatchUserWebhooksParseSettingsHostnameError, PatchUserWebhooksParseSettingsHostnameResponse, GetUserWebhooksParseStatsData, GetUserWebhooksParseStatsError, GetUserWebhooksParseStatsResponse, PostValidationsEmailData, PostValidationsEmailError, PostValidationsEmailResponse, GetVerifiedSendersData, GetVerifiedSendersError, GetVerifiedSendersResponse, PostVerifiedSendersData, PostVerifiedSendersError, PostVerifiedSendersResponse, GetVerifiedSendersDomainsError, GetVerifiedSendersDomainsResponse, PostVerifiedSendersResendIdData, PostVerifiedSendersResendIdError, PostVerifiedSendersResendIdResponse, GetVerifiedSendersStepsCompletedError, GetVerifiedSendersStepsCompletedResponse, GetVerifiedSendersVerifyTokenData, GetVerifiedSendersVerifyTokenError, GetVerifiedSendersVerifyTokenResponse, DeleteVerifiedSendersIdData, DeleteVerifiedSendersIdError, DeleteVerifiedSendersIdResponse, PatchVerifiedSendersIdData, PatchVerifiedSendersIdError, PatchVerifiedSendersIdResponse, PostWhitelabelDnsEmailData, PostWhitelabelDnsEmailError, PostWhitelabelDnsEmailResponse, GetWhitelabelDomainsData, GetWhitelabelDomainsError, GetWhitelabelDomainsResponse, PostWhitelabelDomainsData, PostWhitelabelDomainsError, PostWhitelabelDomainsResponse, GetWhitelabelDomainsDefaultData, GetWhitelabelDomainsDefaultError, GetWhitelabelDomainsDefaultResponse, DeleteWhitelabelDomainsSubuserData, DeleteWhitelabelDomainsSubuserError, DeleteWhitelabelDomainsSubuserResponse, GetWhitelabelDomainsSubuserData, GetWhitelabelDomainsSubuserError, GetWhitelabelDomainsSubuserResponse, DeleteWhitelabelDomainsDomainIdData, DeleteWhitelabelDomainsDomainIdError, DeleteWhitelabelDomainsDomainIdResponse, GetWhitelabelDomainsDomainIdData, GetWhitelabelDomainsDomainIdError, GetWhitelabelDomainsDomainIdResponse, PatchWhitelabelDomainsDomainIdData, PatchWhitelabelDomainsDomainIdError, PatchWhitelabelDomainsDomainIdResponse, PostWhitelabelDomainsDomainIdSubuserData, PostWhitelabelDomainsDomainIdSubuserError, PostWhitelabelDomainsDomainIdSubuserResponse, PostWhitelabelDomainsIdIpsData, PostWhitelabelDomainsIdIpsError, PostWhitelabelDomainsIdIpsResponse, DeleteWhitelabelDomainsIdIpsIpData, DeleteWhitelabelDomainsIdIpsIpError, DeleteWhitelabelDomainsIdIpsIpResponse, PostWhitelabelDomainsIdValidateData, PostWhitelabelDomainsIdValidateError, PostWhitelabelDomainsIdValidateResponse, GetWhitelabelIpsData, GetWhitelabelIpsError, GetWhitelabelIpsResponse, PostWhitelabelIpsData, PostWhitelabelIpsError, PostWhitelabelIpsResponse, DeleteWhitelabelIpsIdData, DeleteWhitelabelIpsIdError, DeleteWhitelabelIpsIdResponse, GetWhitelabelIpsIdData, GetWhitelabelIpsIdError, GetWhitelabelIpsIdResponse, PostWhitelabelIpsIdValidateData, PostWhitelabelIpsIdValidateError, PostWhitelabelIpsIdValidateResponse, GetWhitelabelLinksData, GetWhitelabelLinksError, GetWhitelabelLinksResponse, PostWhitelabelLinksData, PostWhitelabelLinksError, PostWhitelabelLinksResponse, GetWhitelabelLinksDefaultData, GetWhitelabelLinksDefaultError, GetWhitelabelLinksDefaultResponse, DeleteWhitelabelLinksSubuserData, DeleteWhitelabelLinksSubuserError, DeleteWhitelabelLinksSubuserResponse, GetWhitelabelLinksSubuserData, GetWhitelabelLinksSubuserError, GetWhitelabelLinksSubuserResponse, DeleteWhitelabelLinksIdData, DeleteWhitelabelLinksIdError, DeleteWhitelabelLinksIdResponse, GetWhitelabelLinksIdData, GetWhitelabelLinksIdError, GetWhitelabelLinksIdResponse, PatchWhitelabelLinksIdData, PatchWhitelabelLinksIdError, PatchWhitelabelLinksIdResponse, PostWhitelabelLinksIdValidateData, PostWhitelabelLinksIdValidateError, PostWhitelabelLinksIdValidateResponse, PostWhitelabelLinksLinkIdSubuserData, PostWhitelabelLinksLinkIdSubuserError, PostWhitelabelLinksLinkIdSubuserResponse, } from './types.gen'; export const client = createClient(createConfig()); /** * Retrieve all recent access attempts * **This endpoint allows you to retrieve a list of all of the IP addresses that recently attempted to access your account either through the User Interface or the API.** */ export const getAccessSettingsActivity = ( options?: Options, ) => { return (options?.client ?? client).get< GetAccessSettingsActivityResponse, GetAccessSettingsActivityError, ThrowOnError >({ ...options, url: '/access_settings/activity', }); }; /** * Remove one or more IPs from the allow list * **This endpoint allows you to remove one or more IP addresses from your list of allowed addresses.** * * To remove one or more IP addresses, pass this endpoint an array containing the ID(s) associated with the IP(s) you intend to remove. You can retrieve the IDs associated with your allowed IP addresses using the "Retrieve a list of currently allowed IPs" endpoint. * * It is possible to remove your own IP address, which will block access to your account. You will need to submit a [support ticket](https://sendgrid.com/docs/ui/account-and-settings/support/) if this happens. For this reason, it is important to double check that you are removing only the IPs you intend to remove when using this endpoint. */ export const deleteAccessSettingsWhitelist = ( options?: Options, ) => { return (options?.client ?? client).delete< DeleteAccessSettingsWhitelistResponse, DeleteAccessSettingsWhitelistError, ThrowOnError >({ ...options, url: '/access_settings/whitelist', }); }; /** * Retrieve a list of currently allowed IPs * **This endpoint allows you to retrieve a list of IP addresses that are currently allowed to access your account.** * * Each IP address returned to you will have `created_at` and `updated_at` dates. Each IP will also be associated with an `id` that can be used to remove the address from your allow list. */ export const getAccessSettingsWhitelist = ( options?: Options, ) => { return (options?.client ?? client).get< GetAccessSettingsWhitelistResponse, GetAccessSettingsWhitelistError, ThrowOnError >({ ...options, url: '/access_settings/whitelist', }); }; /** * Add one or more IPs to the allow list * **This endpoint allows you to add one or more allowed IP addresses.** * * To allow one or more IP addresses, pass them to this endpoint in an array. Once an IP address is added to your allow list, it will be assigned an `id` that can be used to remove the address. You can retrieve the ID associated with an IP using the "Retrieve a list of currently allowed IPs" endpoint. */ export const postAccessSettingsWhitelist = ( options?: Options, ) => { return (options?.client ?? client).post< PostAccessSettingsWhitelistResponse, PostAccessSettingsWhitelistError, ThrowOnError >({ ...options, url: '/access_settings/whitelist', }); }; /** * Remove a specific IP from the allowed list * **This endpoint allows you to remove a specific IP address from your list of allowed addresses.** * * When removing a specific IP address from your list, you must include the ID in your call. You can retrieve the IDs associated with your allowed IP addresses using the "Retrieve a list of currently allowed IPs" endpoint. */ export const deleteAccessSettingsWhitelistRuleId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteAccessSettingsWhitelistRuleIdResponse, DeleteAccessSettingsWhitelistRuleIdError, ThrowOnError >({ ...options, url: '/access_settings/whitelist/{rule_id}', }); }; /** * Retrieve a specific allowed IP * **This endpoint allows you to retreive a specific IP address that has been allowed to access your account.** * * You must include the ID for the specific IP address you want to retrieve in your call. You can retrieve the IDs associated with your allowed IP addresses using the "Retrieve a list of currently allowed IPs" endpoint. */ export const getAccessSettingsWhitelistRuleId = ( options: Options, ) => { return (options?.client ?? client).get< GetAccessSettingsWhitelistRuleIdResponse, GetAccessSettingsWhitelistRuleIdError, ThrowOnError >({ ...options, url: '/access_settings/whitelist/{rule_id}', }); }; /** * Retrieve all alerts * **This endpoint allows you to retrieve all of your alerts.** * * Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. * * Usage alerts allow you to set the threshold at which an alert will be sent. * * Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". * * For more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/). */ export const getAlerts = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/alerts', }); }; /** * Create a new Alert * **This endpoint allows you to create a new alert.** * * Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. There are two types of alerts that can be created with this endpoint: * * * `usage_limit` allows you to set the threshold at which an alert will be sent. * * `stats_notification` allows you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". * * For more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/). */ export const postAlerts = (options?: Options) => { return (options?.client ?? client).post({ ...options, url: '/alerts', }); }; /** * Delete an alert * **This endpoint allows you to delete an alert.** * * Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. * * Usage alerts allow you to set the threshold at which an alert will be sent. * * Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". * * For more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/). */ export const deleteAlertsAlertId = ( options: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/alerts/{alert_id}', }); }; /** * Retrieve a specific alert * **This endpoint allows you to retrieve a specific alert.** * * Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. * * Usage alerts allow you to set the threshold at which an alert will be sent. * * Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". * * For more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/). */ export const getAlertsAlertId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/alerts/{alert_id}', }); }; /** * Update an alert * **This endpoint allows you to update an alert.** * * Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. * * Usage alerts allow you to set the threshold at which an alert will be sent. * * Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". * * For more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/). */ export const patchAlertsAlertId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/alerts/{alert_id}', }); }; /** * Retrieve all API Keys belonging to the authenticated user * **This endpoint allows you to retrieve all API Keys that belong to the authenticated user.** * * A successful response from this API will include all available API keys' names and IDs. * * For security reasons, there is not a way to retrieve the key itself after it's created. If you lose your API key, you must create a new one. Only the "Create API keys" endpoint will return a key to you and only at the time of creation. * * An `api_key_id` can be used to update or delete the key, as well as retrieve the key's details, such as its scopes. */ export const getApiKeys = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/api_keys', }); }; /** * Create API keys * **This endpoint allows you to create a new API Key for the user.** * * To create your initial SendGrid API Key, you should [use the SendGrid App](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. * * > There is a limit of 100 API Keys on your account. * * A JSON request body containing a `name` property is required when making requests to this endpoint. If the number of maximum keys, 100, is reached, a `403` status will be returned. * * Though the `name` field is required, it does not need to be unique. A unique API key ID will be generated for each key you create and returned in the response body. * * It is not necessary to pass a `scopes` field to the API when creating a key, but you should be aware that omitting the `scopes` field from your request will create a key with "Full Access" permissions by default. * * See the [API Key Permissions List](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization) for all available scopes. An API key's scopes can be updated after creation using the "Update API keys" endpoint. */ export const createApiKeys = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/api_keys', }); }; /** * Delete API keys * **This endpoint allows you to revoke an existing API Key using an `api_key_id`** * * Authentications using a revoked API Key will fail after after some small propogation delay. If the API Key ID does not exist, a `404` status will be returned. */ export const deleteApiKeysApiKeyId = ( options: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/api_keys/{api_key_id}', }); }; /** * Retrieve an existing API Key * **This endpoint allows you to retrieve a single API key using an `api_key_id`.** * * The endpoint will return a key's name, ID, and scopes. If the API Key ID does not, exist a `404` status will be returned. * * See the [API Key Permissions List](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization) for all available scopes. An API key's scopes can be updated after creation using the "Update API keys" endpoint. */ export const getApiKeysApiKeyId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/api_keys/{api_key_id}', }); }; /** * Update API key name * **This endpoint allows you to update the name of an existing API Key.** * * You must pass this endpoint a JSON request body with a `name` property, which will be used to rename the key associated with the `api_key_id` passed in the URL. */ export const patchApiKeysApiKeyId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/api_keys/{api_key_id}', }); }; /** * Update API key name and scopes * **This endpoint allows you to update the name and scopes of a given API key.** * * You must pass this endpoint a JSON request body with a `name` field and a `scopes` array containing at least one scope. The `name` and `scopes` fields will be used to update the key associated with the `api_key_id` in the request URL. * * If you need to update a key's scopes only, pass the `name` field with the key's existing name; the `name` will not be modified. If you need to update a key's name only, use the "Update API key name" endpoint. * * See the [API Key Permissions List](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization) for all available scopes. */ export const putApiKeysApiKeyId = ( options: Options, ) => { return (options?.client ?? client).put({ ...options, url: '/api_keys/{api_key_id}', }); }; /** * Retrieve all suppression groups associated with the user. * **This endpoint allows you to retrieve a list of all suppression groups created by this user.** * * This endpoint can also return information for multiple group IDs that you include in your request. To add a group ID to your request, simply append `?id=123456&id=123456`, with the appropriate group IDs. */ export const getAsmGroups = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/asm/groups', }); }; /** * Create a new suppression group * **This endpoint allows you to create a new suppression group.** * * To add an email address to the suppression group, [create a Suppression](https://sendgrid.api-docs.io/v3.0/suppressions-suppressions/add-suppressions-to-a-suppression-group). */ export const postAsmGroups = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/asm/groups', }); }; /** * Delete a Suppression Group * **This endpoint allows you to delete a suppression group.** * * If a recipient uses the "one-click unsubscribe" option on an email associated with a deleted group, that recipient will be added to the global suppression list. * * Deleting a suppression group will remove the suppression, meaning email will once again be sent to the previously suppressed addresses. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required. */ export const deleteAsmGroupsGroupId = ( options: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/asm/groups/{group_id}', }); }; /** * Get information on a single suppression group. * **This endpoint allows you to retrieve a single suppression group.** */ export const getAsmGroupsGroupId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/asm/groups/{group_id}', }); }; /** * Update a suppression group. * **This endpoint allows you to update or change a suppression group.** */ export const patchAsmGroupsGroupId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/asm/groups/{group_id}', }); }; /** * Retrieve all suppressions for a suppression group * **This endpoint allows you to retrieve all suppressed email addresses belonging to the given group.** */ export const getAsmGroupsGroupIdSuppressions = ( options: Options, ) => { return (options?.client ?? client).get< GetAsmGroupsGroupIdSuppressionsResponse, GetAsmGroupsGroupIdSuppressionsError, ThrowOnError >({ ...options, url: '/asm/groups/{group_id}/suppressions', }); }; /** * Add suppressions to a suppression group * **This endpoint allows you to add email addresses to an unsubscribe group.** * * If you attempt to add suppressions to a group that has been deleted or does not exist, the suppressions will be added to the global suppressions list. */ export const postAsmGroupsGroupIdSuppressions = ( options: Options, ) => { return (options?.client ?? client).post< PostAsmGroupsGroupIdSuppressionsResponse, PostAsmGroupsGroupIdSuppressionsError, ThrowOnError >({ ...options, url: '/asm/groups/{group_id}/suppressions', }); }; /** * Search for suppressions within a group * **This endpoint allows you to search a suppression group for multiple suppressions.** * * When given a list of email addresses and a group ID, this endpoint will only return the email addresses that have been unsubscribed from the given group. */ export const postAsmGroupsGroupIdSuppressionsSearch = ( options: Options, ) => { return (options?.client ?? client).post< PostAsmGroupsGroupIdSuppressionsSearchResponse, PostAsmGroupsGroupIdSuppressionsSearchError, ThrowOnError >({ ...options, url: '/asm/groups/{group_id}/suppressions/search', }); }; /** * Delete a suppression from a suppression group * **This endpoint allows you to remove a suppressed email address from the given suppression group.** * * Removing an address will remove the suppression, meaning email will once again be sent to the previously suppressed addresses. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required. */ export const deleteAsmGroupsGroupIdSuppressionsEmail = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteAsmGroupsGroupIdSuppressionsEmailResponse, DeleteAsmGroupsGroupIdSuppressionsEmailError, ThrowOnError >({ ...options, url: '/asm/groups/{group_id}/suppressions/{email}', }); }; /** * Retrieve all suppressions * **This endpoint allows you to retrieve a list of all suppressions.** */ export const getAsmSuppressions = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/asm/suppressions', }); }; /** * Add recipient addresses to the global suppression group. * **This endpoint allows you to add one or more email addresses to the global suppressions group.** */ export const postAsmSuppressionsGlobal = ( options?: Options, ) => { return (options?.client ?? client).post< PostAsmSuppressionsGlobalResponse, PostAsmSuppressionsGlobalError, ThrowOnError >({ ...options, url: '/asm/suppressions/global', }); }; /** * Delete a Global Suppression * **This endpoint allows you to remove an email address from the global suppressions group.** * * Deleting a suppression group will remove the suppression, meaning email will once again be sent to the previously suppressed addresses. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required. */ export const deleteAsmSuppressionsGlobalEmail = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteAsmSuppressionsGlobalEmailResponse, DeleteAsmSuppressionsGlobalEmailError, ThrowOnError >({ ...options, url: '/asm/suppressions/global/{email}', }); }; /** * Retrieve a Global Suppression * **This endpoint allows you to retrieve a global suppression. You can also use this endpoint to confirm if an email address is already globally suppresed.** * * If the email address you include in the URL path parameter `{email}` is already globally suppressed, the response will include that email address. If the address you enter for `{email}` is not globally suppressed, an empty JSON object `{}` will be returned. */ export const getAsmSuppressionsGlobalEmail = ( options: Options, ) => { return (options?.client ?? client).get< GetAsmSuppressionsGlobalEmailResponse, GetAsmSuppressionsGlobalEmailError, ThrowOnError >({ ...options, url: '/asm/suppressions/global/{email}', }); }; /** * Retrieve all suppression groups for an email address * **This endpoint returns a list of all groups from which the given email address has been unsubscribed.** */ export const getAsmSuppressionsEmail = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/asm/suppressions/{email}', }); }; /** * Retrieve email statistics by browser. * **This endpoint allows you to retrieve your email statistics segmented by browser type.** * * **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. * * Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). */ export const getBrowsersStats = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/browsers/stats', }); }; /** * Retrieve all Campaigns * **This endpoint allows you to retrieve a list of all of your campaigns.** * * Returns campaigns in reverse order they were created (newest first). * * Returns an empty array if no campaigns exist. */ export const getCampaigns = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/campaigns', }); }; /** * Create a Campaign * **This endpoint allows you to create a campaign.** * * In order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both html and plain text), and at least one list or segment ID. This information is not required when you create a campaign. */ export const postCampaigns = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/campaigns', }); }; /** * Delete a Campaign * **This endpoint allows you to delete a specific campaign.** */ export const deleteCampaignsCampaignId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteCampaignsCampaignIdResponse, DeleteCampaignsCampaignIdError, ThrowOnError >({ ...options, url: '/campaigns/{campaign_id}', }); }; /** * Retrieve a single campaign * **This endpoint allows you to retrieve a specific campaign.** */ export const getCampaignsCampaignId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/campaigns/{campaign_id}', }); }; /** * Update a Campaign * **This endpoint allows you to update a specific campaign.** * * This is especially useful if you only set up the campaign using POST /campaigns, but didn't set many of the parameters. */ export const patchCampaignsCampaignId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchCampaignsCampaignIdResponse, PatchCampaignsCampaignIdError, ThrowOnError >({ ...options, url: '/campaigns/{campaign_id}', }); }; /** * Unschedule a Scheduled Campaign * **This endpoint allows you to unschedule a campaign that has already been scheduled to be sent.** * * A successful unschedule will return a 204. * If the specified campaign is in the process of being sent, the only option is to cancel (a different method). */ export const deleteCampaignsCampaignIdSchedules = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteCampaignsCampaignIdSchedulesResponse, DeleteCampaignsCampaignIdSchedulesError, ThrowOnError >({ ...options, url: '/campaigns/{campaign_id}/schedules', }); }; /** * View Scheduled Time of a Campaign * **This endpoint allows you to retrieve the date and time that a campaign has been scheduled to be sent.** */ export const getCampaignsCampaignIdSchedules = ( options: Options, ) => { return (options?.client ?? client).get< GetCampaignsCampaignIdSchedulesResponse, GetCampaignsCampaignIdSchedulesError, ThrowOnError >({ ...options, url: '/campaigns/{campaign_id}/schedules', }); }; /** * Update a Scheduled Campaign * **This endpoint allows to you change the scheduled time and date for a campaign to be sent.** */ export const patchCampaignsCampaignIdSchedules = ( options: Options, ) => { return (options?.client ?? client).patch< PatchCampaignsCampaignIdSchedulesResponse, PatchCampaignsCampaignIdSchedulesError, ThrowOnError >({ ...options, url: '/campaigns/{campaign_id}/schedules', }); }; /** * Schedule a Campaign * **This endpoint allows you to schedule a specific date and time for your campaign to be sent.** * * If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid those times (for example, scheduling at 10:53) can result in lower deferral rates because it won't be going through our servers at the same times as everyone else's mail. */ export const postCampaignsCampaignIdSchedules = ( options: Options, ) => { return (options?.client ?? client).post< PostCampaignsCampaignIdSchedulesResponse, PostCampaignsCampaignIdSchedulesError, ThrowOnError >({ ...options, url: '/campaigns/{campaign_id}/schedules', }); }; /** * Send a Campaign * **This endpoint allows you to immediately send an existing campaign.** * * Normally a POST request would have a body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed. */ export const postCampaignsCampaignIdSchedulesNow = ( options: Options, ) => { return (options?.client ?? client).post< PostCampaignsCampaignIdSchedulesNowResponse, PostCampaignsCampaignIdSchedulesNowError, ThrowOnError >({ ...options, url: '/campaigns/{campaign_id}/schedules/now', }); }; /** * Send a Test Campaign * **This endpoint allows you to send a test campaign.** * * To send to multiple addresses, use an array for the JSON "to" value ["one@address","two@address"] */ export const postCampaignsCampaignIdSchedulesTest = ( options: Options, ) => { return (options?.client ?? client).post< PostCampaignsCampaignIdSchedulesTestResponse, PostCampaignsCampaignIdSchedulesTestError, ThrowOnError >({ ...options, url: '/campaigns/{campaign_id}/schedules/test', }); }; /** * Retrieve all categories * **This endpoint allows you to retrieve a list of all of your categories.** */ export const getCategories = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/categories', }); }; /** * Retrieve Email Statistics for Categories * **This endpoint allows you to retrieve all of your email statistics for each of your categories.** * * If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. */ export const getCategoriesStats = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/categories/stats', }); }; /** * Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?] * **This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.** * * If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. */ export const getCategoriesStatsSums = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/categories/stats/sums', }); }; /** * Retrieve email statistics by client type. * **This endpoint allows you to retrieve your email statistics segmented by client type.** * * **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. * * Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). */ export const getClientsStats = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/clients/stats', }); }; /** * Retrieve stats by a specific client type. * **This endpoint allows you to retrieve your email statistics segmented by a specific client type.** * * **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. * * ## Available Client Types * - phone * - tablet * - webmail * - desktop * * Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). */ export const getClientsClientTypeStats = ( options: Options, ) => { return (options?.client ?? client).get< GetClientsClientTypeStatsResponse, GetClientsClientTypeStatsError, ThrowOnError >({ ...options, url: '/clients/{client_type}/stats', }); }; /** * Retrieve all custom fields * **This endpoint allows you to retrieve all custom fields.** */ export const getContactdbCustomFields = ( options?: Options, ) => { return (options?.client ?? client).get( { ...options, url: '/contactdb/custom_fields', }, ); }; /** * Create a Custom Field * **This endpoint allows you to create a custom field.** * * **You can create up to 120 custom fields.** */ export const postContactdbCustomFields = ( options?: Options, ) => { return (options?.client ?? client).post< PostContactdbCustomFieldsResponse, PostContactdbCustomFieldsError, ThrowOnError >({ ...options, url: '/contactdb/custom_fields', }); }; /** * Delete a Custom Field * **This endpoint allows you to delete a custom field by ID.** */ export const deleteContactdbCustomFieldsCustomFieldId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteContactdbCustomFieldsCustomFieldIdResponse, DeleteContactdbCustomFieldsCustomFieldIdError, ThrowOnError >({ ...options, url: '/contactdb/custom_fields/{custom_field_id}', }); }; /** * Retrieve a Custom Field * **This endpoint allows you to retrieve a custom field by ID.** */ export const getContactdbCustomFieldsCustomFieldId = ( options: Options, ) => { return (options?.client ?? client).get< GetContactdbCustomFieldsCustomFieldIdResponse, GetContactdbCustomFieldsCustomFieldIdError, ThrowOnError >({ ...options, url: '/contactdb/custom_fields/{custom_field_id}', }); }; /** * Delete Multiple lists * **This endpoint allows you to delete multiple recipient lists.** */ export const deleteContactdbLists = ( options?: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/contactdb/lists', }); }; /** * Retrieve all lists * **This endpoint allows you to retrieve all of your recipient lists. If you don't have any lists, an empty array will be returned.** */ export const getContactdbLists = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/contactdb/lists', }); }; /** * Create a List * **This endpoint allows you to create a list for your recipients.** */ export const postContactdbLists = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/contactdb/lists', }); }; /** * Delete a List * **This endpoint allows you to delete a specific recipient list with the given ID.** */ export const deleteContactdbListsListId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteContactdbListsListIdResponse, DeleteContactdbListsListIdError, ThrowOnError >({ ...options, url: '/contactdb/lists/{list_id}', } as any); }; /** * Retrieve a single list * **This endpoint allows you to retrieve a single recipient list.** */ export const getContactdbListsListId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/contactdb/lists/{list_id}', }); }; /** * Update a List * **This endpoint allows you to update the name of one of your recipient lists.** */ export const patchContactdbListsListId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchContactdbListsListIdResponse, PatchContactdbListsListIdError, ThrowOnError >({ ...options, url: '/contactdb/lists/{list_id}', }); }; /** * Retrieve all recipients on a List * **This endpoint allows you to retrieve all recipients on the list with the given ID.** */ export const getContactdbListsListIdRecipients = ( options: Options, ) => { return (options?.client ?? client).get< GetContactdbListsListIdRecipientsResponse, GetContactdbListsListIdRecipientsError, ThrowOnError >({ ...options, url: '/contactdb/lists/{list_id}/recipients', }); }; /** * Add Multiple Recipients to a List * **This endpoint allows you to add multiple recipients to a list.** * * Adds existing recipients to a list, passing in the recipient IDs to add. Recipient IDs should be passed exactly as they are returned from recipient endpoints. */ export const postContactdbListsListIdRecipients = ( options: Options, ) => { return (options?.client ?? client).post< PostContactdbListsListIdRecipientsResponse, PostContactdbListsListIdRecipientsError, ThrowOnError >({ ...options, url: '/contactdb/lists/{list_id}/recipients', }); }; /** * Delete a Single Recipient from a Single List * **This endpoint allows you to delete a single recipient from a list.** */ export const deleteContactdbListsListIdRecipientsRecipientId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteContactdbListsListIdRecipientsRecipientIdResponse, DeleteContactdbListsListIdRecipientsRecipientIdError, ThrowOnError >({ ...options, url: '/contactdb/lists/{list_id}/recipients/{recipient_id}', } as any); }; /** * Add a Single Recipient to a List * **This endpoint allows you to add a single recipient to a list.** */ export const postContactdbListsListIdRecipientsRecipientId = ( options: Options, ) => { return (options?.client ?? client).post< PostContactdbListsListIdRecipientsRecipientIdResponse, PostContactdbListsListIdRecipientsRecipientIdError, ThrowOnError >({ ...options, url: '/contactdb/lists/{list_id}/recipients/{recipient_id}', }); }; /** * Delete Recipients * **This endpoint allows you to deletes one or more recipients.** * * The body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete. */ export const deleteContactdbRecipients = ( options?: Options, ) => { return (options?.client ?? client).delete< DeleteContactdbRecipientsResponse, DeleteContactdbRecipientsError, ThrowOnError >({ ...options, url: '/contactdb/recipients', }); }; /** * Retrieve recipients * **This endpoint allows you to retrieve all of your Marketing Campaigns recipients.** * * Batch deletion of a page makes it possible to receive an empty page of recipients before reaching the end of * the list of recipients. To avoid this issue; iterate over pages until a 404 is retrieved. */ export const getContactdbRecipients = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/contactdb/recipients', }); }; /** * Update Recipient * **This endpoint allows you to update one or more recipients.** * * The body of an API call to this endpoint must include an array of one or more recipient objects. * * It is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields SendGrid provides. */ export const patchContactdbRecipients = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchContactdbRecipientsResponse, PatchContactdbRecipientsError, ThrowOnError >({ ...options, url: '/contactdb/recipients', }); }; /** * Add recipients * **This endpoint allows you to add a Marketing Campaigns recipient.** * * You can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides. * * The rate limit is three requests every 2 seconds. You can upload 1000 contacts per request. So the maximum upload rate is 1500 recipients per second. */ export const postContactdbRecipients = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/contactdb/recipients', }); }; /** * Retrieve the count of billable recipients * **This endpoint allows you to retrieve the number of Marketing Campaigns recipients that you will be billed for.** * * You are billed for marketing campaigns based on the highest number of recipients you have had in your account at one time. This endpoint will allow you to know the current billable count value. */ export const getContactdbRecipientsBillableCount = ( options?: Options, ) => { return (options?.client ?? client).get< GetContactdbRecipientsBillableCountResponse, GetContactdbRecipientsBillableCountError, ThrowOnError >({ ...options, url: '/contactdb/recipients/billable_count', }); }; /** * Retrieve a Count of Recipients * **This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.** */ export const getContactdbRecipientsCount = ( options?: Options, ) => { return (options?.client ?? client).get< GetContactdbRecipientsCountResponse, GetContactdbRecipientsCountError, ThrowOnError >({ ...options, url: '/contactdb/recipients/count', }); }; /** * Search recipients * **This endpoint allows you to perform a search on all of your Marketing Campaigns recipients.** * * field_name: * * * is a variable that is substituted for your actual custom field name from your recipient. * * Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200) * * If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert * your epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to * Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through * Mon, 02 Feb 2015 23:59:59 GMT. */ export const getContactdbRecipientsSearch = ( options?: Options, ) => { return (options?.client ?? client).get< GetContactdbRecipientsSearchResponse, GetContactdbRecipientsSearchError, ThrowOnError >({ ...options, url: '/contactdb/recipients/search', }); }; /** * Search recipients *

* Search using segment conditions without actually creating a segment. * Body contains a JSON object with conditions, a list of conditions as described below, and an optional list_id, which is a valid list ID for a list to limit the search on. *

* *

* Valid operators for create and update depend on the type of the field for which you are searching. *

* *
    *
  • Dates: *
      *
    • "eq", "ne", "lt" (before), "gt" (after) *
        *
      • You may use MM/DD/YYYY for day granularity or an epoch for second granularity.
      • *
      *
    • *
    • "empty", "not_empty"
    • *
    • "is within" * *
    • *
    *
  • *
  • Text: "contains", "eq" (is - matches the full field), "ne" (is not - matches any field where the entire field is not the condition value), "empty", "not_empty"
  • *
  • Numbers: "eq", "lt", "gt", "empty", "not_empty"
  • *
  • Email Clicks and Opens: "eq" (opened), "ne" (not opened)
  • *
* *

* Field values must all be a string. *

* *

* Search conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either clicks.campaign_identifier or opens.campaign_identifier. * The condition value should be a string containing the id of a completed campaign. *

* *

* Search conditions list may contain multiple conditions, joined by an "and" or "or" in the "and_or" field. * The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or". *

*/ export const postContactdbRecipientsSearch = ( options?: Options, ) => { return (options?.client ?? client).post< PostContactdbRecipientsSearchResponse, PostContactdbRecipientsSearchError, ThrowOnError >({ ...options, url: '/contactdb/recipients/search', }); }; /** * Delete a Recipient * **This endpoint allows you to delete a single recipient with the given ID from your contact database.** * * > Use this to permanently delete your recipients from all of your contact lists and all segments if required by applicable law. */ export const deleteContactdbRecipientsRecipientId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteContactdbRecipientsRecipientIdResponse, DeleteContactdbRecipientsRecipientIdError, ThrowOnError >({ ...options, url: '/contactdb/recipients/{recipient_id}', }); }; /** * Retrieve a single recipient * **This endpoint allows you to retrieve a single recipient by ID from your contact database.** */ export const getContactdbRecipientsRecipientId = ( options: Options, ) => { return (options?.client ?? client).get< GetContactdbRecipientsRecipientIdResponse, GetContactdbRecipientsRecipientIdError, ThrowOnError >({ ...options, url: '/contactdb/recipients/{recipient_id}', }); }; /** * Retrieve the lists that a recipient is on * **This endpoint allows you to retrieve the lists that a given recipient belongs to.** * * Each recipient can be on many lists. This endpoint gives you all of the lists that any one recipient has been added to. */ export const getContactdbRecipientsRecipientIdLists = ( options: Options, ) => { return (options?.client ?? client).get< GetContactdbRecipientsRecipientIdListsResponse, GetContactdbRecipientsRecipientIdListsError, ThrowOnError >({ ...options, url: '/contactdb/recipients/{recipient_id}/lists', }); }; /** * Retrieve reserved fields * **This endpoint allows you to list all fields that are reserved and can't be used for custom field names.** */ export const getContactdbReservedFields = ( options?: Options, ) => { return (options?.client ?? client).get< GetContactdbReservedFieldsResponse, GetContactdbReservedFieldsError, ThrowOnError >({ ...options, url: '/contactdb/reserved_fields', }); }; /** * Retrieve all segments * **This endpoint allows you to retrieve all of your segments.** */ export const getContactdbSegments = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/contactdb/segments', }); }; /** * Create a Segment * **This endpoint allows you to create a new segment.** * * * Valid operators for create and update depend on the type of the field for which you are searching. * * **Dates** * - "eq", "ne", "lt" (before), "gt" (after) * - You may use MM/DD/YYYY for day granularity or an epoch for second granularity. * - "empty", "not_empty" * - "is within" * - You may use an [ISO 8601 date format](https://en.wikipedia.org/wiki/ISO_8601) or the # of days. * * **Text** * - "contains" * - "eq" (is/equals - matches the full field) * - "ne" (is not/not equals - matches any field where the entire field is not the condition value) * - "empty" * - "not_empty" * * **Numbers** * - "eq" (is/equals) * - "lt" (is less than) * - "gt" (is greater than) * - "empty" * - "not_empty" * * **Email Clicks and Opens** * - "eq" (opened) * - "ne" (not opened) * * All field values must be a string. * * * Conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either `clicks.campaign_identifier` or `opens.campaign_identifier`. * The condition value should be a string containing the id of a completed campaign. * * * The conditions list may contain multiple conditions, joined by an "and" or "or" in the "and_or" field. * * The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or". */ export const postContactdbSegments = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/contactdb/segments', }); }; /** * Delete a segment * **This endpoint allows you to delete a segment from your recipients database.** * * You also have the option to delete all the contacts from your Marketing Campaigns recipient database who were in this segment. */ export const deleteContactdbSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteContactdbSegmentsSegmentIdResponse, DeleteContactdbSegmentsSegmentIdError, ThrowOnError >({ ...options, url: '/contactdb/segments/{segment_id}', } as any); }; /** * Retrieve a segment * **This endpoint allows you to retrieve a single segment with the given ID.** */ export const getContactdbSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).get< GetContactdbSegmentsSegmentIdResponse, GetContactdbSegmentsSegmentIdError, ThrowOnError >({ ...options, url: '/contactdb/segments/{segment_id}', }); }; /** * Update a segment * **This endpoint allows you to update a segment.** */ export const patchContactdbSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchContactdbSegmentsSegmentIdResponse, PatchContactdbSegmentsSegmentIdError, ThrowOnError >({ ...options, url: '/contactdb/segments/{segment_id}', }); }; /** * Retrieve recipients on a segment * **This endpoint allows you to retrieve all of the recipients in a segment with the given ID.** */ export const getContactdbSegmentsSegmentIdRecipients = ( options: Options, ) => { return (options?.client ?? client).get< GetContactdbSegmentsSegmentIdRecipientsResponse, GetContactdbSegmentsSegmentIdRecipientsError, ThrowOnError >({ ...options, url: '/contactdb/segments/{segment_id}/recipients', }); }; /** * Get Recipient Upload Status * **This endpoint allows you to check the upload status of a Marketing Campaigns recipient.** */ export const getContactdbStatus = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/contactdb/status', }); }; /** * List Designs * **This endpoint allows you to retrieve a list of designs already stored in your Design Library**. * * A GET request to `/designs` will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the `/designs/pre-builts` endpoint, which is detailed below. * * By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. */ export const listDesigns = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/designs', }); }; /** * Create Design * **This endpoint allows you to create a new design**. * * You can add a new design by passing data, including a string of HTML email content, to `/designs`. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to [Cross-Platform Email Design](https://sendgrid.com/docs/ui/sending-email/cross-platform-html-design/). * * The Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the [Design and Code Editor documentation](https://sendgrid.com/docs/ui/sending-email/editor/#drag--drop-markup). * * Because the `/designs` endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI. */ export const postDesigns = (options?: Options) => { return (options?.client ?? client).post({ ...options, url: '/designs', }); }; /** * List SendGrid Pre-built Designs * **This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid**. * * Unlike the `/designs` endpoint where *your* designs are stored, a GET request made to `designs/pre-builts` will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library. * * By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. * * This endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify. */ export const listSendgridPreBuiltDesigns = ( options?: Options, ) => { return (options?.client ?? client).get< ListSendgridPreBuiltDesignsResponse, ListSendgridPreBuiltDesignsError, ThrowOnError >({ ...options, url: '/designs/pre-builts', }); }; /** * Get SendGrid Pre-built Design * **This endpoint allows you to retrieve a single pre-built design**. * * A GET request to `/designs/pre-builts/{id}` will retrieve details about a specific pre-built design. * * This endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify. */ export const getSendgridPreBuiltDesign = ( options: Options, ) => { return (options?.client ?? client).get< GetSendgridPreBuiltDesignResponse, GetSendgridPreBuiltDesignError, ThrowOnError >({ ...options, url: '/designs/pre-builts/{id}', }); }; /** * Duplicate SendGrid Pre-built Design * **This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs**. * * Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text "Duplicate: " prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the "List SendGrid Pre-built Designs" endpoint. * * You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. * More on retrieving design IDs can be found above. */ export const postSendgridPreBuiltDesign = ( options: Options, ) => { return (options?.client ?? client).post< PostSendgridPreBuiltDesignResponse, PostSendgridPreBuiltDesignError, ThrowOnError >({ ...options, url: '/designs/pre-builts/{id}', }); }; /** * Delete Design * **This endpoint allows you to delete a single design**. * * Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action. */ export const deleteDesign = ( options: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/designs/{id}', }); }; /** * Get Design * **This endpoint allows you to retrieve a single design**. * * A GET request to `/designs/{id}` will retrieve details about a specific design in your Design Library. * * This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request. */ export const getDesign = (options: Options) => { return (options?.client ?? client).get({ ...options, url: '/designs/{id}', }); }; /** * Update Design * **This endpoint allows you to edit a design**. * * The Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered. * * For example, updating a design's name requires that you make a PATCH request to this endpoint with data specified for the `name` field only. * * ``` * { * "name": "" * } * ``` */ export const putDesign = (options: Options) => { return (options?.client ?? client).patch({ ...options, url: '/designs/{id}', }); }; /** * Duplicate Design * **This endpoint allows you to duplicate one of your existing designs**. * * Modifying an existing design is often the easiest way to create something new. * * You are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text "Duplicate: " prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs. * * You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. * More on retrieving design IDs can be found below. */ export const postDesign = (options: Options) => { return (options?.client ?? client).post({ ...options, url: '/designs/{id}', }); }; /** * Retrieve email statistics by device type. * **This endpoint allows you to retrieve your email statistics segmented by the device type.** * * **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. * * ## Available Device Types * | **Device** | **Description** | **Example** | * |---|---|---| * | Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | * | Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | * | Phone | A smart phone. | iPhone, Android, Blackberry, etc. * | Tablet | A tablet computer. | iPad, android based tablet, etc. | * | Other | An unrecognized device. | * * Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). */ export const getDevicesStats = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/devices/stats', }); }; /** * Retrieve email statistics by country and state/province. * **This endpoint allows you to retrieve your email statistics segmented by country and state/province.** * * **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. * * Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html). */ export const getGeoStats = (options: Options) => { return (options?.client ?? client).get({ ...options, url: '/geo/stats', }); }; /** * Retrieve all IP addresses * **This endpoint allows you to retrieve a list of all assigned and unassigned IPs.** * * Response includes warm up status, pools, assigned subusers, and reverse DNS info. The start_date field corresponds to when warmup started for that IP. * * A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. */ export const getIps = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/ips', }); }; /** * Add IPs * **This endpoint is for adding a(n) IP Address(es) to your account.** */ export const postIps = (options?: Options) => { return (options?.client ?? client).post({ ...options, url: '/ips', }); }; /** * Retrieve all assigned IPs * **This endpoint allows you to retrieve only assigned IP addresses.** * * A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. */ export const getIpsAssigned = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/ips/assigned', }); }; /** * Retrieve all IP pools * **This endpoint allows you to get all of your IP pools.** */ export const getIpsPools = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/ips/pools', }); }; /** * Create an IP pool * **This endpoint allows you to create an IP pool.** * * Before you can create an IP pool, you need to activate the IP in your SendGrid account: * * 1. Log into your SendGrid account. * 1. Navigate to **Settings** and then select **IP Addresses**. * 1. Find the IP address you want to activate and then click **Edit**. * 1. Check **Allow my account to send mail using this IP address**. * 1. Click **Save**. */ export const postIpsPools = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/ips/pools', }); }; /** * Delete an IP pool * **This endpoint allows you to delete an IP pool.** */ export const deleteIpsPoolsPoolName = ( options: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/ips/pools/{pool_name}', }); }; /** * Retrieve all the IPs in a specified pool * **This endpoint allows you to get all of the IP addresses that are in a specific IP pool.** */ export const getIpsPoolsPoolName = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/ips/pools/{pool_name}', }); }; /** * Rename an IP pool * **This endpoint allows you to update the name of an IP pool.** */ export const putIpsPoolsPoolName = ( options: Options, ) => { return (options?.client ?? client).put({ ...options, url: '/ips/pools/{pool_name}', }); }; /** * Add an IP address to a pool * **This endpoint allows you to add an IP address to an IP pool.** * * You can add the same IP address to multiple pools. It may take up to 60 seconds for your IP address to be added to a pool after your request is made. * * Before you can add an IP to a pool, you need to activate it in your SendGrid account: * * 1. Log into your SendGrid account. * 1. Navigate to **Settings** and then select **IP Addresses**. * 1. Find the IP address you want to activate and then click **Edit**. * 1. Check **Allow my account to send mail using this IP address**. * 1. Click **Save**. * * You can retrieve all of your available IP addresses from the "Retrieve all IP addresses" endpoint. */ export const postIpsPoolsPoolNameIps = ( options: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/ips/pools/{pool_name}/ips', }); }; /** * Remove an IP address from a pool * **This endpoint allows you to remove an IP address from an IP pool.** */ export const deleteIpsPoolsPoolNameIpsIp = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteIpsPoolsPoolNameIpsIpResponse, DeleteIpsPoolsPoolNameIpsIpError, ThrowOnError >({ ...options, url: '/ips/pools/{pool_name}/ips/{ip}', }); }; /** * Get remaining IPs count * **This endpoint gets amount of IP Addresses that can still be created during a given period and the price of those IPs.** */ export const getIpsRemaining = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/ips/remaining', }); }; /** * Retrieve all IPs currently in warmup * **This endpoint allows you to retrieve all of your IP addresses that are currently warming up.** */ export const getIpsWarmup = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/ips/warmup', }); }; /** * Start warming up an IP address * **This endpoint allows you to put an IP address into warmup mode.** */ export const postIpsWarmup = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/ips/warmup', }); }; /** * Stop warming up an IP address * **This endpoint allows you to remove an IP address from warmup mode.** * * Your request will return a 204 status code if the specified IP was successfully removed from warmup mode. To retrieve details of the IP’s warmup status *before* removing it from warmup mode, call the "Retrieve the warmpup status for a specific IP address" endpoint. */ export const deleteIpsWarmupIpAddress = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteIpsWarmupIpAddressResponse, DeleteIpsWarmupIpAddressError, ThrowOnError >({ ...options, url: '/ips/warmup/{ip_address}', }); }; /** * Retrieve the warmup status for a specific IP address * **This endpoint allows you to retrieve the warmup status for a specific IP address.** * * You can retrieve all of your warming IPs using the "Retrieve all IPs currently in warmup" endpoint. */ export const getIpsWarmupIpAddress = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/ips/warmup/{ip_address}', }); }; /** * Retrieve all IP pools an IP address belongs to * **This endpoint allows you to see which IP pools a particular IP address has been added to.** * * The same IP address can be added to multiple IP pools. * * A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. */ export const getIpsIpAddress = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/ips/{ip_address}', }); }; /** * Create a batch ID * **This endpoint allows you to generate a new batch ID.** * * Once a `batch_id` is created, you can associate it with a scheduled send using the `/mail/send` endpoint. Passing the `batch_id` as a field in the `/mail/send` request body will assign the ID to the send you are creating. * * Once an ID is associated with a scheduled send, the send can be accessed and its send status can be modified using the `batch_id`. */ export const postMailBatch = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/mail/batch', }); }; /** * Validate batch ID * **This endpoint allows you to validate a batch ID.** * * When you pass a valid `batch_id` to this endpoint, it will return a `200` status code and the batch ID itself. * * If you pass an invalid `batch_id` to the endpoint, you will receive a `400` level status code and an error message. * * A `batch_id` does not need to be assigned to a scheduled send to be considered valid. A successful response means only that the `batch_id` has been created, but it does not indicate that it has been associated with a send. */ export const getMailBatchBatchId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/mail/batch/{batch_id}', }); }; /** * v3 Mail Send * The Mail Send endpoint allows you to send email over SendGrid’s v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). * * ## Helper Libraries * * Twilio SendGrid provides libraries to help you quickly and easily integrate with the v3 Web API in 7 different languages: * * * [C#](https://github.com/sendgrid/sendgrid-csharp) * * [Go](https://github.com/sendgrid/sendgrid-go) * * [Java](https://github.com/sendgrid/sendgrid-java) * * [Node JS](https://github.com/sendgrid/sendgrid-nodejs) * * [PHP](https://github.com/sendgrid/sendgrid-php) * * [Python](https://github.com/sendgrid/sendgrid-python) * * [Ruby](https://github.com/sendgrid/sendgrid-ruby) * * ## Dynamic Transactional Templates and Handlebars * * In order to send a dynamic template, specify the template ID with the `template_id` parameter. * * To specify handlebar substitutions, define your substitutions in the request JSON with this syntax: * * ``` * "dynamic_template_data": { * "guest": "Jane Doe", * "partysize": "4", * "english": true, * "date": "April 1st, 2021" * } * ``` * * For more information about Dynamic Transactional Templates and Handlebars, see our documentation and reference pages. * * * [How to send an email with Dynamic Transactional Templates * ](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) * * [Using Handlebars](https://sendgrid.com/docs/for-developers/sending-email/using-handlebars/) * * ## Mail Body Compression * * Mail body compression is available to some high volume accounts. Talk to your CSM if you are interested in this functionality. Mail body compression works by setting up a JSON payload as defined on this page, then compressing it with gzip (the gzip file can be no more than 30mb). * * To use mail body compression: * * 1. Add a `Content-Encoding` header, with a value of `gzip`. * a. `Content-Encoding: gzip` * 2. Send the gzip as a data-binary. * a. `--data-binary '@data.json.gz' * ` * * ## Multiple Reply-To Emails * * Using `reply_to_list` allows senders to include more than one recipient email address to receive reply and/or bounce messages from the recipient of the email. * * ### Usage Considerations * * * `reply_to` is mutually exclusive with `reply_to_list`. If both are used, then the API call will be rejected. * * The `reply_to_list` object, when used, must at least have an email parameter and may also contain a name parameter. * * Each email address in the `reply_to_list` should be unique. * * There is a limit of 1000 `reply_to_list` emails per mail/send request. * * In SMTP calls, we will omit any invalid emails. * * ### Possible 400 Error Messages * * * `reply_to` is mutually exclusive with `reply_to_list`. * * The `reply_to_list` object, when used, must at least have an email parameter and may also contain a name parameter. * * Each email address in the `reply_to_list` should be unique. * * There is a limit of X `reply_to` emails per mail/send request. * * The `reply_to_list` email does not contain a valid address. * * The `reply_to_list` email exceeds the maximum total length of X characters. * * The `reply_to_list` email parameter is required. */ export const postMailSend = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/mail/send', }); }; /** * Retrieve all mail settings * **This endpoint allows you to retrieve a list of all mail settings.** * * Each setting will be returned with an `enabled` status set to `true` or `false` and a short description that explains what the setting does. */ export const getMailSettings = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/mail_settings', }); }; /** * Retrieve address whitelist mail settings * **This endpoint allows you to retrieve your current email address whitelist settings.** * * The Address Whitelist setting allows you to specify email addresses or domains for which mail should never be suppressed. * * For example, if you own the domain `example.com`, and one or more of your recipients use `email@example.com` addresses, placing `example.com` in the address whitelist setting instructs Twilio SendGrid to ignore all bounces, blocks, and unsubscribes logged for that domain. In other words, all bounces, blocks, and unsubscribes will still be sent to `example.com` as if they were sent under normal sending conditions. */ export const getMailSettingsAddressWhitelist = ( options?: Options, ) => { return (options?.client ?? client).get< GetMailSettingsAddressWhitelistResponse, GetMailSettingsAddressWhitelistError, ThrowOnError >({ ...options, url: '/mail_settings/address_whitelist', }); }; /** * Update address whitelist mail settings * **This endpoint allows you to update your current email address whitelist settings.** * * You can select whether or not this setting should be enabled by assigning the `enabled` field a `true` or `false` value. * * Passing only the `enabled` field to this endpoint will not alter your current `list` of whitelist entries. However, any modifications to your `list` of entries will overwrite the entire list. For this reason, you must included all existing entries you wish to retain in your `list` in addition to any new entries you intend to add. To remove one or more `list` entries, pass a `list` with only the entries you wish to retain. * * You should not add generic domains such as `gmail.com` or `yahoo.com` in your `list` because your emails will not honor recipients' unsubscribes. This may cause a legal violation of [CAN-SPAM](https://sendgrid.com/docs/glossary/can-spam/) and could damage your sending reputation. * * The Address Whitelist setting allows you to specify email addresses or domains for which mail should never be suppressed. * * For example, if you own the domain `example.com`, and one or more of your recipients use `email@example.com` addresses, placing `example.com` in the address whitelist setting instructs Twilio SendGrid to ignore all bounces, blocks, and unsubscribes logged for that domain. In other words, all bounces, blocks, and unsubscribes will still be sent to `example.com` as if they were sent under normal sending conditions. */ export const patchMailSettingsAddressWhitelist = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchMailSettingsAddressWhitelistResponse, PatchMailSettingsAddressWhitelistError, ThrowOnError >({ ...options, url: '/mail_settings/address_whitelist', }); }; /** * Retrieve bounce purge mail settings * **This endpoint allows you to retrieve your current bounce and purge settings.** * * The Bounce Perge setting allows you to set a schedule that Twilio SendGrid will use to automatically delete contacts from your soft and hard bounce suppression lists. * * A hard bounce occurs when an email message has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown. * * A soft bounce occurs when an email message reaches the recipient's mail server but is bounced back undelivered before it actually reaches the recipient. A soft bounce might occur because the recipient's inbox is full. * * You can also manage this setting in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). You can manage your bounces manually using the [Bounces API](https://sendgrid.api-docs.io/v3.0/bounces-api) or the [Bounces menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces). */ export const getMailSettingsBouncePurge = ( options?: Options, ) => { return (options?.client ?? client).get< GetMailSettingsBouncePurgeResponse, GetMailSettingsBouncePurgeError, ThrowOnError >({ ...options, url: '/mail_settings/bounce_purge', }); }; /** * Update bounce purge mail settings * **This endpoint allows you to update your current bounce and purge settings.** * * The Bounce Perge setting allows you to set a schedule that Twilio SendGrid will use to automatically delete contacts from your soft and hard bounce suppression lists. The schedule is set in full days by assigning the number of days, an integer, to the `soft_bounces` and/or `hard_bounces` fields. * * A hard bounce occurs when an email message has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown. * * A soft bounce occurs when an email message reaches the recipient's mail server but is bounced back undelivered before it actually reaches the recipient. A soft bounce might occur because the recipient's inbox is full. * * You can also manage this setting in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). You can manage your bounces manually using the [Bounces API](https://sendgrid.api-docs.io/v3.0/bounces-api) or the [Bounces menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces). */ export const patchMailSettingsBouncePurge = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchMailSettingsBouncePurgeResponse, PatchMailSettingsBouncePurgeError, ThrowOnError >({ ...options, url: '/mail_settings/bounce_purge', }); }; /** * Retrieve footer mail settings * **This endpoint allows you to retrieve your current Footer mail settings.** * * The Footer setting will insert a custom footer at the bottom of your text and HTML email message bodies. * * You can insert your HTML or plain text directly using the "Update footer mail settings" endpoint, or you can create the footer using the [Mail Settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). */ export const getMailSettingsFooter = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/mail_settings/footer', }); }; /** * Update footer mail settings * **This endpoint allows you to update your current Footer mail settings.** * * The Footer setting will insert a custom footer at the bottom of your text and HTML email message bodies. * * You can insert your HTML or plain text directly using this endpoint, or you can create the footer using the [Mail Settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). */ export const patchMailSettingsFooter = ( options?: Options, ) => { return (options?.client ?? client).patch( { ...options, url: '/mail_settings/footer', }, ); }; /** * Retrieve forward bounce mail settings * **This endpoint allows you to retrieve your current bounce forwarding mail settings.** * * Enabling the Forward Bounce setting allows you to specify `email` addresses to which bounce reports will be forwarded. This endpoint returns the email address you have set to receive forwarded bounces and an `enabled` status indicating if the setting is active. */ export const getMailSettingsForwardBounce = ( options?: Options, ) => { return (options?.client ?? client).get< GetMailSettingsForwardBounceResponse, GetMailSettingsForwardBounceError, ThrowOnError >({ ...options, url: '/mail_settings/forward_bounce', }); }; /** * Update forward bounce mail settings * **This endpoint allows you to update your current bounce forwarding mail settings.** * * Enabling the Forward Bounce setting allows you to specify an `email` address to which bounce reports will be forwarded. * * You can also configure the Forward Spam mail settings in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). */ export const patchMailSettingsForwardBounce = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchMailSettingsForwardBounceResponse, PatchMailSettingsForwardBounceError, ThrowOnError >({ ...options, url: '/mail_settings/forward_bounce', }); }; /** * Retrieve forward spam mail settings * **This endpoint allows you to retrieve your current Forward Spam mail settings.** * * Enabling the Forward Spam setting allows you to specify `email` addresses to which spam reports will be forwarded. This endpoint returns any email address(es) you have set to receive forwarded spam and an `enabled` status indicating if the setting is active. */ export const getMailSettingsForwardSpam = ( options?: Options, ) => { return (options?.client ?? client).get< GetMailSettingsForwardSpamResponse, GetMailSettingsForwardSpamError, ThrowOnError >({ ...options, url: '/mail_settings/forward_spam', }); }; /** * Update forward spam mail settings * **This endpoint allows you to update your current Forward Spam mail settings.** * * Enabling the Forward Spam setting allows you to specify `email` addresses to which spam reports will be forwarded. You can set multiple addresses by passing this endpoint a comma separated list of emails in a single string. * * ``` * { * "email": "address1@example.com, address2@exapmle.com", * "enabled": true * } * ``` * * The Forward Spam setting may also be used to receive emails sent to `abuse@` and `postmaster@` role addresses if you have authenticated your domain. * * For example, if you authenticated `example.com` as your root domain and set a custom return path of `sub` for that domain, you could turn on Forward Spam, and any emails sent to `abuse@sub.example.com` or `postmaster@sub.example.com` would be forwarded to the email address you entered in the `email` field. * * You can authenticate your domain using the "Authenticate a domain" endpoint or in the [Sender Authentication section of the Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth). You can also configure the Forward Spam mail settings in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). */ export const patchMailSettingsForwardSpam = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchMailSettingsForwardSpamResponse, PatchMailSettingsForwardSpamError, ThrowOnError >({ ...options, url: '/mail_settings/forward_spam', }); }; /** * Retrieve legacy template mail settings * **This endpoint allows you to retrieve your current legacy email template settings.** * * This setting refers to our original email templates. We currently support more fully featured [Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). * * The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. For instructions on using legacy templates, see how to ["Create and Edit Legacy Transactional Templates](https://sendgrid.com/docs/ui/sending-email/create-and-edit-legacy-transactional-templates/). For help migrating to our current template system, see ["Migrating from Legacy Templates"](https://sendgrid.com/docs/ui/sending-email/migrating-from-legacy-templates/). */ export const getMailSettingsTemplate = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/mail_settings/template', }); }; /** * Update template mail settings * **This endpoint allows you to update your current legacy email template settings.** * * This setting refers to our original email templates. We currently support more fully featured [Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). * * The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. For instructions on using legacy templates, see how to ["Create and Edit Legacy Transactional Templates](https://sendgrid.com/docs/ui/sending-email/create-and-edit-legacy-transactional-templates/). For help migrating to our current template system, see ["Migrating from Legacy Templates"](https://sendgrid.com/docs/ui/sending-email/migrating-from-legacy-templates/). */ export const patchMailSettingsTemplate = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchMailSettingsTemplateResponse, PatchMailSettingsTemplateError, ThrowOnError >({ ...options, url: '/mail_settings/template', }); }; /** * Retrieve email statistics by mailbox provider. * **This endpoint allows you to retrieve your email statistics segmented by recipient mailbox provider.** * * **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. * * Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). */ export const getMailboxProvidersStats = ( options: Options, ) => { return (options?.client ?? client).get( { ...options, url: '/mailbox_providers/stats', }, ); }; /** * Delete Contacts * **This endpoint can be used to delete one or more contacts**. * * The query parameter `ids` must set to a comma-separated list of contact IDs for bulk contact deletion. * * The query parameter `delete_all_contacts` must be set to `"true"` to delete **all** contacts. * * You must set either `ids` or `delete_all_contacts`. * * Deletion jobs are processed asynchronously. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const deleteMcContacts = ( options?: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/marketing/contacts', }); }; /** * Get Sample Contacts * **This endpoint will return up to 50 of the most recent contacts uploaded or attached to a list**. * * This list will then be sorted by email address. * * The full contact count is also returned. * * Please note that pagination of the contacts has been deprecated. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const getMcContats = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/marketing/contacts', }); }; /** * Add or Update a Contact * **This endpoint allows the [upsert](https://en.wiktionary.org/wiki/upsert) (insert or update) of up to 30,000 contacts, or 6MB of data, whichever is lower**. * * Because the creation and update of contacts is an asynchronous process, the response will not contain immediate feedback on the processing of your upserted contacts. Rather, it will contain an HTTP 202 response indicating the contacts are queued for processing or an HTTP 4XX error containing validation errors. Should you wish to get the resulting contact's ID or confirm your contacts have been updated or added, you can use the "Get Contacts by Emails" endpoint. * * Please note that custom fields need to have been already created if you wish to set their values for the contacts being upserted. To do this, please use the "Create Custom Field Definition" endpoint. * * You will see a `job_id` in the response to your request. This can be used to check the status of your upsert job. To do so, please use the "Import Contacts Status" endpoint. * * If the contact already exists in the system, any entries submitted via this endpoint will update the existing contact. The contact to update will be determined only by the `email` field and any fields omitted from the request will remain as they were. A contact's ID cannot be used to update the contact. * * The email field will be changed to all lower-case. If a contact is added with an email that exists but contains capital letters, the existing contact with the all lower-case email will be updated. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const putMcContacts = ( options?: Options, ) => { return (options?.client ?? client).put({ ...options, url: '/marketing/contacts', }); }; /** * Get Batched Contacts by IDs * **This endpoint is used to retrieve a set of contacts identified by their IDs.** * * This can be more efficient endpoint to get contacts than making a series of individual `GET` requests to the "Get a Contact by ID" endpoint. * * You can supply up to 100 IDs. Pass them into the `ids` field in your request body as an array or one or more strings. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const postMarketingContactsBatch = ( options?: Options, ) => { return (options?.client ?? client).post< PostMarketingContactsBatchResponse, PostMarketingContactsBatchError, ThrowOnError >({ ...options, url: '/marketing/contacts/batch', }); }; /** * Get Total Contact Count * **This endpoint returns the total number of contacts you have stored.** * * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const getMcContactsCount = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/marketing/contacts/count', }); }; /** * Get All Existing Exports * **Use this endpoint to retrieve details of all current exported jobs**. * * It will return an array of objects, each of which records an export job in flight or recently completed. * * Each object's `export_type` field will tell you which kind of export it is and its `status` field will indicate what stage of processing it has reached. Exports which are `ready` will be accompanied by a `urls` field which lists the URLs of the export's downloadable files — there will be more than one if you specified a maximum file size in your initial export request. * * Use this endpoint if you have exports in flight but do not know their IDs, which are required for the "Export Contacts Status" endpoint. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const getMarketingContactsExports = ( options?: Options, ) => { return (options?.client ?? client).get< GetMarketingContactsExportsResponse, GetMarketingContactsExportsError, ThrowOnError >({ ...options, url: '/marketing/contacts/exports', }); }; /** * Export Contacts * **Use this endpoint to export lists or segments of contacts**. * * If you would just like to have a link to the exported list sent to your email set the `notifications.email` option to `true` in the `POST` payload. * * If you would like to download the list, take the `id` that is returned and use the "Export Contacts Status" endpoint to get the `urls`. Once you have the list of URLs, make a `GET` request to each URL provided to download your CSV file(s). * * You specify the segements and or/contact lists you wish to export by providing the relevant IDs in, respectively, the `segment_ids` and `list_ids` fields in the request body. * * The lists will be provided in either JSON or CSV files. To specify which of these you would required, set the request body `file_type` field to `json` or `csv`. * * You can also specify a maximum file size (in MB). If the export file is larger than this, it will be split into multiple files. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const postMcContactsExports = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/marketing/contacts/exports', }); }; /** * Export Contacts Status * **This endpoint can be used to check the status of a contact export job**. * * To use this call, you will need the `id` from the "Export Contacts" call. * * If you would like to download a list, take the `id` that is returned from the "Export Contacts" endpoint and make an API request here to get the `urls`. Once you have the list of URLs, make a `GET` request on each URL to download your CSV file(s). * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const getMcContactsExportsId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/contacts/exports/{id}', }); }; /** * Import Contacts * **This endpoint allows a CSV upload containing up to one million contacts or 5GB of data, whichever is smaller.** * * Imports take place asynchronously: the endpoint returns a URL (`upload_uri`) and HTTP headers (`upload_headers`) which can subsequently be used to `PUT` a file of contacts to be imported into our system. * * Uploaded CSV files may also be [gzip-compressed](https://en.wikipedia.org/wiki/Gzip). * * In either case, you must include the field `file_type` with the value `csv` in your request body. * * The `field_mappings` paramter is a respective list of field definition IDs to map the uploaded CSV columns to. It allows you to use CSVs where one or more columns are skipped (`null`) or remapped to the contact field. * * For example, if `field_mappings` is set to `[null, "w1", "_rf1"]`, this means skip column 0, map column 1 to the custom field with the ID `w1`, and map column 2 to the reserved field with the ID `_rf1`. See the "Get All Field Definitions" endpoint to fetch your custom and reserved field IDs to use with `field_mappings`. * * Once you recieve the response body you can then initiate a **second** API call where you use the supplied URL and HTTP header to upload your file. For example: * * `curl --upload-file "file/path.csv" "URL_GIVEN" -H 'HEADER_GIVEN'` * * If you'd like to monitor the status of your import job, use the `job_id` and the "Import Contacts Status" endpoint. * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const putMcContactsImports = ( options?: Options, ) => { return (options?.client ?? client).put({ ...options, url: '/marketing/contacts/imports', }); }; /** * Import Contacts Status * **This endpoint can be used to check the status of a contact import job**. * * Use the `job_id` from the "Import Contacts," "Add or Update a Contact," or "Delete Contacts" endpoints as the `id` in the path parameter. * * If there is an error with your `PUT` request, download the `errors_url` file and open it to view more details. * * The job `status` field indicates whether the job is `pending`, `completed`, `errored`, or `failed`. * * Pending means not started. Completed means finished without any errors. Errored means finished with some errors. Failed means finshed with all errors, or the job was entirely unprocessable: for example, if you attempt to import file format we do not support. * * The `results` object will have fields depending on the job type. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const getMarketingContactsImportsId = ( options: Options, ) => { return (options?.client ?? client).get< GetMarketingContactsImportsIdResponse, GetMarketingContactsImportsIdError, ThrowOnError >({ ...options, url: '/marketing/contacts/imports/{id}', }); }; /** * Search Contacts * **Use this endpoint to locate contacts**. * * The request body's `query` field accepts valid [SGQL](https://sendgrid.com/docs/for-developers/sending-email/segmentation-query-language/) for searching for a contact. * * Because contact emails are stored in lower case, using SGQL to search by email address requires the provided email address to be in lower case. The SGQL `lower()` function can be used for this. * * Only the first 50 contacts that meet the search criteria will be returned. * * If the query takes longer than 20 seconds, a `408 Request Timeout` status will be returned. * * Formatting the `created_at` and `updated_at` values as Unix timestamps is deprecated. Instead they are returned as ISO format as string. * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const postMcContactsSearch = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/marketing/contacts/search', }); }; /** * Get Contacts by Emails * **This endpoint allows you to retrieve up to 100 contacts matching the searched `email` address(es), including any `alternate_emails`.** * * Email addresses are unique to a contact, meaning this endpoint can treat an email address as a primary key to search by. The contact object associated with the address, whether it is their `email` or one of their `alternate_emails` will be returned if matched. * * Email addresses in the search request do not need to match the case in which they're stored, but the email addresses in the result will be all lower case. Empty strings are excluded from the search and will not be returned. * * This endpoint should be used in place of the "Search Contacts" endpoint when you can provide exact email addresses and do not need to include other [Segmentation Query Language (SGQL)](https://sendgrid.com/docs/for-developers/sending-email/segmentation-query-language/) filters when searching. * * If you need to access a large percentage of your contacts, we recommend exporting your contacts with the "Export Contacts" endpoint and filtering the results client side. * * This endpoint returns a `200` status code when any contacts match the address(es) you supplied. When searching multiple addresses in a single request, it is possible that some addresses will match a contact while others will not. When a partially successful search like this is made, the matching contacts are returned in an object and an error message is returned for the email address(es) that are not found. * * This endpoint returns a `404` status code when no contacts are found for the provided email address(es). * * A `400` status code is returned if any searched addresses are invalid. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const postMarketingContactsSearchEmails = ( options?: Options, ) => { return (options?.client ?? client).post< PostMarketingContactsSearchEmailsResponse, PostMarketingContactsSearchEmailsError, ThrowOnError >({ ...options, url: '/marketing/contacts/search/emails', }); }; /** * Get a Contact by ID * **This endpoint returns the full details and all fields for the specified contact**. * * The "Get Contacts by Emails" endpoint can be used to get the ID of a contact. * * Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data. */ export const getMcContactsId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/contacts/{id}', }); }; /** * Get All Field Definitions * **This endpoint retrieves all defined Custom Fields and Reserved Fields.** */ export const getMcFieldDefinitions = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/field_definitions', }); }; /** * Create Custom Field Definition * **This endpoint creates a new custom field definition.** * * Custom field definitions are created with the given `name` and `field_type`. Although field names are stored in a case-sensitive manner, all field names must be case-insensitively unique. This means you may create a field named `CamelCase` or `camelcase`, but not both. Additionally, a Custom Field name cannot collide with any Reserved Field names. You should save the returned `id` value in order to update or delete the field at a later date. You can have up to 120 custom fields. * * The custom field name should be created using only alphanumeric characters (A-Z and 0-9) and underscores (\_). Custom fields can only begin with letters A-Z or underscores (_). The field type can be date, text, or number fields. The field type is important for creating segments from your contact database. * * **Note: Creating a custom field that begins with a number will cause issues with sending in Marketing Campaigns.** */ export const postMcFieldDefinitions = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/marketing/field_definitions', }); }; /** * Delete Custom Field Definition * **This endpoint deletes a defined Custom Field.** * * You cand delete only Custom Fields; Reserved Fields cannot be deleted. */ export const deleteMcFieldDefinitionsCustomFieldId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteMcFieldDefinitionsCustomFieldIdResponse, DeleteMcFieldDefinitionsCustomFieldIdError, ThrowOnError >({ ...options, url: '/marketing/field_definitions/{custom_field_id}', }); }; /** * Update Custom Field Definition * **This endopoint allows you to update a defined Custom Field.** * * Only your Custom fields can be modified; Reserved Fields cannot be updated. */ export const patchMcFieldDefinitionsCustomFieldId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchMcFieldDefinitionsCustomFieldIdResponse, PatchMcFieldDefinitionsCustomFieldIdError, ThrowOnError >({ ...options, url: '/marketing/field_definitions/{custom_field_id}', }); }; /** * Get All Lists * **This endpoint returns an array of all of your contact lists.** */ export const getMcLists = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/marketing/lists', }); }; /** * Create List * **This endpoint creates a new contacts list.** * * Once you create a list, you can use the UI to [trigger an automation](https://sendgrid.com/docs/ui/sending-email/getting-started-with-automation/#create-an-automation) every time you add a new contact to the list. * * A link to the newly created object is in `_metadata`. */ export const postMcLists = (options?: Options) => { return (options?.client ?? client).post({ ...options, url: '/marketing/lists', }); }; /** * Delete a list * **This endpoint allows you to deletes a specific list.** * * Optionally, you can also delete contacts associated to the list. The query parameter, `delete_contacts=true`, will delete the list and start an asynchronous job to delete associated contacts. */ export const deleteListsId = ( options: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/marketing/lists/{id}', }); }; /** * Get a List by ID * **This endpoint returns data about a specific list.** * * Setting the optional parameter `contact_sample=true` returns the `contact_sample` in the response body. Up to fifty of the most recent contacts uploaded or attached to a list will be returned, sorted alphabetically, by email address. * * The full contact count is also returned. */ export const getMcListsId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/lists/{id}', }); }; /** * Update List * **This endpoint updates the name of a list.** */ export const patchMcListsId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/marketing/lists/{id}', }); }; /** * Remove Contacts from a List * **This endpoint allows you to remove contacts from a given list.** * * The contacts will not be deleted. Only their list membership will be changed. */ export const deleteMcListsIdContacts = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteMcListsIdContactsResponse, DeleteMcListsIdContactsError, ThrowOnError >({ ...options, url: '/marketing/lists/{id}/contacts', }); }; /** * Get List Contact Count * **This endpoint returns the number of contacts on a specific list.** */ export const getMcListsIdContactsCount = ( options: Options, ) => { return (options?.client ?? client).get< GetMcListsIdContactsCountResponse, GetMcListsIdContactsCountError, ThrowOnError >({ ...options, url: '/marketing/lists/{id}/contacts/count', }); }; /** * Get List of Segments * **This endpoint allows you to retrieve a list of segments.** * * The query param `parent_list_ids` is treated as a filter. Any match will be returned. 0 matches will return a response code of 200 with an empty `results` array. * * `parent_list_ids` | `no_parent_list_id` | `result` * -----------------:|:--------------------:|:------------- * empty | false | all segments * values | false | segments filtered by list_ids * values | true | segments filtered by list_ids and segments with no parent list_ids * empty | true | segments with no parent list_ids */ export const getMarketingSegments = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/segments', }); }; /** * Create Segment * **This endpoint allows you to create a segment.** */ export const postMarketingSegments = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/marketing/segments', }); }; /** * Get List of Segments * **The Segmentation V2 API is currently in private beta. If you'd like to be added to the beta, please fill out this [form]({https://docs.google.com/forms/d/e/1FAIpQLSd5zwC9dRk8lAp1oTWjdGc-aSY69flW_7wnutvKBhpUluSnfQ/viewform)** * * The query param `parent_list_ids` is treated as a filter. Any match will be returned. 0 matches will return a response code of 200 with an empty `results` array. * * `parent_list_ids` | `no_parent_list_id` | `result` * -----------------:|:--------------------:|:------------- * empty | false | all segments * values | false | segments filtered by list_ids * values | true | segments filtered by list_ids and segments with no parent list_ids * empty | true | segments with no parent list_ids */ export const getSegments = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/marketing/segments/2.0', }); }; /** * Create Segment * **The Segmentation V2 API is currently in private beta. If you'd like to be added to the beta, please fill out this [form]({https://docs.google.com/forms/d/e/1FAIpQLSd5zwC9dRk8lAp1oTWjdGc-aSY69flW_7wnutvKBhpUluSnfQ/viewform)** * * Segment `name` has to be unique. A user can not create a new segment with an existing segment name. */ export const postSegments = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/marketing/segments/2.0', }); }; /** * Delete segment * **The Segmentation V2 API is currently in private beta. If you'd like to be added to the beta, please fill out this [form]({https://docs.google.com/forms/d/e/1FAIpQLSd5zwC9dRk8lAp1oTWjdGc-aSY69flW_7wnutvKBhpUluSnfQ/viewform)** */ export const deleteSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSegmentsSegmentIdResponse, DeleteSegmentsSegmentIdError, ThrowOnError >({ ...options, url: '/marketing/segments/2.0/{segment_id}', }); }; /** * Get Segment by ID * **The Segmentation V2 API is currently in private beta. If you'd like to be added to the beta, please fill out this [form]({https://docs.google.com/forms/d/e/1FAIpQLSd5zwC9dRk8lAp1oTWjdGc-aSY69flW_7wnutvKBhpUluSnfQ/viewform)** */ export const getSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/segments/2.0/{segment_id}', }); }; /** * Update Segment * **The Segmentation V2 API is currently in private beta. If you'd like to be added to the beta, please fill out this [form]({https://docs.google.com/forms/d/e/1FAIpQLSd5zwC9dRk8lAp1oTWjdGc-aSY69flW_7wnutvKBhpUluSnfQ/viewform)** * * Segment `name` has to be unique. A user can not create a new segment with an existing segment name. */ export const patchSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/marketing/segments/2.0/{segment_id}', }); }; /** * Bulk Delete Segments * This endpoint allows you to delete segments in bulk. * * If the segments are used by automations or the segments do not exist in the database, the segment IDs that could not be deleted along with automation IDs that are associated to those segments will be returned. */ export const postMarketingSegmentsDelete = ( options?: Options, ) => { return (options?.client ?? client).post< PostMarketingSegmentsDeleteResponse, PostMarketingSegmentsDeleteError, ThrowOnError >({ ...options, url: '/marketing/segments/delete', }); }; /** * Delete Segment * **This endpoint allows you to delete a segment by `segment_id`.** * * Note that deleting a segment does not delete the contacts associated with the segment by default. Contacts associated with a deleted segment will remain in your list of all contacts and any other segments they belong to. */ export const deleteMarketingSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteMarketingSegmentsSegmentIdResponse, DeleteMarketingSegmentsSegmentIdError, ThrowOnError >({ ...options, url: '/marketing/segments/{segment_id}', }); }; /** * Get Segment by ID * **This endpoint allows you to retrieve a single segment by ID.** */ export const getMarketingSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).get< GetMarketingSegmentsSegmentIdResponse, GetMarketingSegmentsSegmentIdError, ThrowOnError >({ ...options, url: '/marketing/segments/{segment_id}', }); }; /** * Update Segment * **This endpoint allows you to update a segment.** * * Segment `name` needs to be unique. A user can not update a segment name to an existing one. */ export const patchMarketingSegmentsSegmentId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchMarketingSegmentsSegmentIdResponse, PatchMarketingSegmentsSegmentIdError, ThrowOnError >({ ...options, url: '/marketing/segments/{segment_id}', }); }; /** * Create a Sender Identity * **This endpoint allows you to create a new sender identity.** * * *You may create up to 100 unique sender identities.* * * Sender identities are required to be verified before use. If your domain has been authenticated, a new sender identity will auto verify on creation. Otherwise an email will be sent to the `from.email`. */ export const postMarketingSenders = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/marketing/senders', }); }; /** * Bulk Delete Single Sends * **This endpoint allows you to delete multiple Single Sends using an array of Single Sends IDs.** * * To first retrieve all your Single Sends' IDs, you can make a GET request to the `/marketing/singlensends` endpoint. * * Please note that a DELETE request is permanent, and your Single Sends will not be recoverable after deletion. */ export const deleteMarketingSinglesends = ( options?: Options, ) => { return (options?.client ?? client).delete< DeleteMarketingSinglesendsResponse, DeleteMarketingSinglesendsError, ThrowOnError >({ ...options, url: '/marketing/singlesends', }); }; /** * Get All Single Sends * **This endpoint allows you to retrieve all your Single Sends.** * * Returns all of your Single Sends with condensed details about each, including the Single Sends' IDs. For more details about an individual Single Send, pass the Single Send's ID to the `/marketing/singlesends/{id}` endpoint. */ export const getMarketingSinglesends = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/singlesends', }); }; /** * Create Single Send * **This endpoint allows you to create a new Single Send.** * * Please note that if you are migrating from the previous version of Single Sends, you no longer need to pass a template ID with your request to this endpoint. Instead, you will pass all template data in the `email_config` object. */ export const postMarketingSinglesends = ( options?: Options, ) => { return (options?.client ?? client).post< PostMarketingSinglesendsResponse, PostMarketingSinglesendsError, ThrowOnError >({ ...options, url: '/marketing/singlesends', }); }; /** * Get All Categories * **This endpoint allows you to retrieve all the categories associated with your Single Sends.** * * This endpoint will return your latest 1,000 categories. */ export const getMarketingSinglesendsCategories = ( options?: Options, ) => { return (options?.client ?? client).get< GetMarketingSinglesendsCategoriesResponse, GetMarketingSinglesendsCategoriesError, ThrowOnError >({ ...options, url: '/marketing/singlesends/categories', }); }; /** * Get Single Sends Search * **This endpoint allows you to search for Single Sends based on specified criteria.** * * You can search for Single Sends by passing a combination of values using the `name`, `status`, and `categories` request body fields. * * For example, if you want to search for all Single Sends that are "drafts" or "scheduled" and also associated with the category "shoes," your request body may look like the example below. * * ```javascript * { * "status": [ * "draft", * "scheduled" * ], * "categories": [ * "shoes" * ], * } * ``` */ export const postMarketingSinglesendsSearch = ( options?: Options, ) => { return (options?.client ?? client).post< PostMarketingSinglesendsSearchResponse, PostMarketingSinglesendsSearchError, ThrowOnError >({ ...options, url: '/marketing/singlesends/search', }); }; /** * Delete Single Send by ID * **This endpoint allows you to delete one Single Send using a Single Send ID.** * * To first retrieve all your Single Sends' IDs, you can make a GET request to the `/marketing/singlensends` endpoint. * * Please note that a `DELETE` request is permanent, and your Single Send will not be recoverable after deletion. */ export const deleteMarketingSinglesendsId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteMarketingSinglesendsIdResponse, DeleteMarketingSinglesendsIdError, ThrowOnError >({ ...options, url: '/marketing/singlesends/{id}', }); }; /** * Get Single Send by ID * **This endpoint allows you to retrieve details about one Single Send using a Single Send ID.** * * You can retrieve all of your Single Sends by making a GET request to the `/marketing/singlesends` endpoint. */ export const getMarketingSinglesendsId = ( options: Options, ) => { return (options?.client ?? client).get< GetMarketingSinglesendsIdResponse, GetMarketingSinglesendsIdError, ThrowOnError >({ ...options, url: '/marketing/singlesends/{id}', }); }; /** * Update Single Send * **This endpoint allows you to update a Single Send using a Single Send ID.** * * You only need to pass the fields you want to update. Any blank/missing fields will remain unaltered. */ export const patchMarketingSinglesendsId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchMarketingSinglesendsIdResponse, PatchMarketingSinglesendsIdError, ThrowOnError >({ ...options, url: '/marketing/singlesends/{id}', }); }; /** * Duplicate Single Send * **This endpoint allows you to duplicate an existing Single Send using its Single Send ID.** * * Duplicating a Single Send is useful when you want to create a Single Send but don't want to start from scratch. Once duplicated, you can update or edit the Single Send by making a PATCH request to the `/marketing/singlesends/{id}` endpoint. * * If you leave the `name` field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text “Copy of ” prepended to it. The `name` field length is limited to 100 characters, so the end of the new Single Send name, including “Copy of ”, will be trimmed if the name exceeds this limit. */ export const postMarketingSinglesendsId = ( options: Options, ) => { return (options?.client ?? client).post< PostMarketingSinglesendsIdResponse, PostMarketingSinglesendsIdError, ThrowOnError >({ ...options, url: '/marketing/singlesends/{id}', }); }; /** * Delete Single Send Schedule * **This endpoint allows you to cancel a scheduled Single Send using a Single Send ID.** * * Making a DELETE request to this endpoint will cancel the scheduled sending of a Single Send. The request will not delete the Single Send itself. Deleting a Single Send can be done by passing a DELETE request to `/marketing/singlesends/{id}`. */ export const deleteMarketingSinglesendsIdSchedule = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteMarketingSinglesendsIdScheduleResponse, DeleteMarketingSinglesendsIdScheduleError, ThrowOnError >({ ...options, url: '/marketing/singlesends/{id}/schedule', }); }; /** * Schedule Single Send * **This endpoint allows you to schedule a Single Send for future delivery using a Single Send ID.** * * To schedule a Single Send, you must pass a date string in ISO 8601 time format (yyyy-MM-ddTHH:mm:ssZ) using the required `send_at` field. For example, the ISO 8601 format for 9:00 AM UTC on May 6, 2020 would be `2020-05-06T09:00:00Z`. You may also pass the string `"now"` to send the Single Send immediately. */ export const putMarketingSinglesendsIdSchedule = ( options: Options, ) => { return (options?.client ?? client).put< PutMarketingSinglesendsIdScheduleResponse, PutMarketingSinglesendsIdScheduleError, ThrowOnError >({ ...options, url: '/marketing/singlesends/{id}/schedule', }); }; /** * Get All Automation Stats * **This endpoint allows you to retrieve stats for all your Automations.** * * By default, all of your Automations will be returned, but you can specify a selection by passing in a comma-separated list of Automation IDs as the value of the query string parameter `automation_ids`. * * Responses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 50, but you specify a value between 1 and 100. * * You can retrieve a specific page of responses with the `page_token` query string parameter. */ export const getallAutomationStats = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/stats/automations', }); }; /** * Export Automation Stats * **This endpoint allows you to export Automation stats as CSV data**. * * You can specify one Automation or many: include as many Automation IDs as you need, separating them with commas, as the value of the `ids` query string paramter. * * The data is returned as plain text response but in CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a `.csv` file. */ export const getAutomationsStatsExport = ( options?: Options, ) => { return (options?.client ?? client).get< GetAutomationsStatsExportResponse, GetAutomationsStatsExportError, ThrowOnError >({ ...options, url: '/marketing/stats/automations/export', }); }; /** * Get Automation Stats by ID * **This endpoint allows you to retrieve stats for a single Automation using its ID.** * * Multiple Automation IDs can be retrieved using the "Get All Automation Stats" endpoint. Once you have an ID, this endpoint will return detailed stats for the single automation specified. * * You may constrain the stats returned using the `start_date` and `end_date` query string parameters. You can also use the `group_by` and `aggregated_by` query string parameters to further refine the stats returned. */ export const getAutomationStat = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/stats/automations/{id}', }); }; /** * Get Automation Click Tracking Stats by ID * **This endpoint lets you retrieve click-tracking stats for a single Automation**. * * The stats returned list the URLs embedded in your Automation and the number of clicks each one received. * * Responses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 50, but you specify a value between 1 and 100. * * You can retrieve a specific page of responses with the `page_token` query string parameter. */ export const getAutomationLinkStat = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/stats/automations/{id}/links', }); }; /** * Get All Single Sends Stats * **This endpoint allows you to retrieve stats for all your Single Sends.** * * By default, all of your Single Sends will be returned, but you can specify a selection by passing in a comma-separated list of Single Send IDs as the value of the query string parameter `singlesend_ids`. * * Responses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 50, but you specify a value between 1 and 100. * * You can retrieve a specific page of responses with the `page_token` query string parameter. */ export const getallSinglesendStats = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/stats/singlesends', }); }; /** * Export Single Send Stats * **This endpoint allows you to export Single Send stats as .CSV data**. * * You can specify one Single Send or many: include as many Single Send IDs as you need, separating them with commas, as the value of the `ids` query string paramter. * * The data is returned as plain text response but in .CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a .csv file. */ export const getSinglesendStatsExport = ( options?: Options, ) => { return (options?.client ?? client).get( { ...options, url: '/marketing/stats/singlesends/export', }, ); }; /** * Get Single Send Stats by ID * **This endpoint allows you to retrieve stats for an individual Single Send using a Single Send ID.** * * Multiple Single Send IDs can be retrieved using the "Get All Single Sends Stats" endpoint. Once you have an ID, this endpoint will return detailed stats for the Single Send specified. * * You may constrain the stats returned using the `start_date` and `end_date` query string parameters. You can also use the `group_by` and `aggregated_by` query string parameters to further refine the stats returned. */ export const getSinglesendStat = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/stats/singlesends/{id}', }); }; /** * Get Single Send Click Tracking Stats by ID * **This endpoint lets you retrieve click-tracking stats for one Single Send**. * * The stats returned list the URLs embedded in the specified Single Send and the number of clicks each one received. * * Responses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 50, but you specify a value between 1 and 100. * * You can retrieve a specific page of responses with the `page_token` query string parameter. */ export const getSinglesendLinkStat = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/marketing/stats/singlesends/{id}/links', }); }; /** * Send a Test Marketing Email * **This endpoint allows you to send a test marketing email to a list of email addresses**. * * Before sending a marketing message, you can test it using this endpoint. You may specify up to **10 contacts** in the `emails` request body field. You must also specify a `template_id` and include either a `from_address` or `sender_id`. You can manage your templates with the [Twilio SendGrid App](https://mc.sendgrid.com/dynamic-templates) or the [Transactional Templates API](https://sendgrid.api-docs.io/v3.0/transactional-templates). * * > Please note that this endpoint works with Dynamic Transactional Templates only. Legacy Transactional Templates will not be delivered. * * For more information about managing Dynamic Transactional Templates, see [How to Send Email with Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). * * You can also test your Single Sends in the [Twilio SendGrid Marketing Campaigns UI](https://mc.sendgrid.com/single-sends). */ export const postMarketingTestSendEmail = ( options?: Options, ) => { return (options?.client ?? client).post< PostMarketingTestSendEmailResponse, PostMarketingTestSendEmailError, ThrowOnError >({ ...options, url: '/marketing/test/send_email', }); }; /** * Filter all messages * This is **BETA** functionality. You may not have access, and we reserve the right to change functionality without notice. * * Filter all messages to search your Email Activity. All queries need to be [URL encoded](https://meyerweb.com/eric/tools/dencoder/), and have this format: * * `query={query_type}="{query_content}"` * * encoded, this would look like this: * * `query=type%3D%22query_content%22` * * for example: * * Filter by a specific email - `query=to_email%3D%22example%40example.com%22` * * Filter by subject line - `query=subject%3d%22A%20Great%20Subject%22` * * **Full list of basic query types and examples:** * * * | **Filter query** | **Unencoded Example** (put this one into the try it out query - it'll automatically encode it for you) | **Encoded Example** (use this one in your code) | * |-----------------|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------| * | msg_id | msg_id=“filter0307p1las1-16816-5A023E36-1.0” | msg_id%3D%22filter0307p1las1-16816-5A023E36-1.0%22 | * | from_email | from_email=“testing@sendgrid.net” | from_email%3D%22testing%40sendgrid.net%22 | * | subject | subject="This is a subject test" | subject%22This%20is%20a%20subject%20test%22 | * | to_email | to_email="example@example.com" | to_email%3D%22example%40example.com%22 | * | status | | status%22processed%22 | * | template_id | | | * | asm_group_id | | | * | api_key_id | | | * | events | status="processed" | status%3D%22processed%22 | * | originating_ip | | | * | categories | | | * | unique_args | | | * | outbound_ip | | | * | last_event_time | last_event_time=“2017-11-07T23:13:58Z” | last_event_time%3D%E2%80%9C2017-11-07T23%3A13%3A58Z%E2%80%9D | * | clicks | clicks="0" | clicks%3D%220%22 | * * For information about building compound queries, and for the full query language functionality, see the [query language reference](https://docs.google.com/a/sendgrid.com/document/d/1fWoKTFNfg5UUsB6t9KuIcSo9CetKF_T0bGfWJ_gdPCs/edit?usp=sharing). * * Coming soon, example compound queries: limit + to email + date */ export const getMessages = (options: Options) => { return (options?.client ?? client).get({ ...options, url: '/messages', }); }; /** * Request CSV * This is BETA functionality. You may not have access, and we reserve the right to change functionality without notice. * * This request will kick off a backend process to generate a CSV file. Once generated, the worker will then send an email for the user download the file. The link will expire in 3 days. * * The CSV fill contain the last 1 million messages. This endpoint will be rate limited to 1 request every 12 hours (rate limit may change). * * This endpoint is similar to the GET Single Message endpoint - the only difference is that /download is added to indicate that this is a CSV download requests but the same query is used to determine what the CSV should contain. */ export const postV3MessagesDownload = ( options: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/messages/download', }); }; /** * Download CSV * **This endpoint will return a presigned URL that can be used to download the CSV that was requested from the "Request a CSV" endpoint.** */ export const getV3MessagesDownloadDownloadUuid = ( options: Options, ) => { return (options?.client ?? client).get< GetV3MessagesDownloadDownloadUuidResponse, GetV3MessagesDownloadDownloadUuidError, ThrowOnError >({ ...options, url: '/messages/download/{download_uuid}', }); }; /** * Filter messages by message ID * This is BETA functionality. You may not have access, and we reserve the right to change functionality without notice. * * Get all of the details about the specified message. */ export const getV3MessagesMsgId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/messages/{msg_id}', }); }; /** * Returns a list of all partner settings. * **This endpoint allows you to retrieve a list of all partner settings that you can enable.** * * Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [Partners documentation](https://sendgrid.com/docs/ui/account-and-settings/partners/). */ export const getPartnerSettings = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/partner_settings', }); }; /** * Returns all New Relic partner settings. * **This endpoint allows you to retrieve your current New Relic partner settings.** * * Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [Partners documentation](https://sendgrid.com/docs/ui/account-and-settings/partners/). * * By integrating with New Relic, you can send your SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [SendGrid for New Relic documentation](https://sendgrid.com/docs/ui/analytics-and-reporting/tracking-stats-using-new-relic/). */ export const getPartnerSettingsNewRelic = ( options?: Options, ) => { return (options?.client ?? client).get< GetPartnerSettingsNewRelicResponse, GetPartnerSettingsNewRelicError, ThrowOnError >({ ...options, url: '/partner_settings/new_relic', }); }; /** * Updates New Relic partner settings. * **This endpoint allows you to update or change your New Relic partner settings.** * * Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [Partners documentation](https://sendgrid.com/docs/ui/account-and-settings/partners/). * * By integrating with New Relic, you can send your SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [SendGrid for New Relic documentation](https://sendgrid.com/docs/ui/analytics-and-reporting/tracking-stats-using-new-relic/). */ export const patchPartnerSettingsNewRelic = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchPartnerSettingsNewRelicResponse, PatchPartnerSettingsNewRelicError, ThrowOnError >({ ...options, url: '/partner_settings/new_relic', }); }; /** * Retrieve a list of scopes for which this user has access. * **This endpoint returns a list of all scopes that this user has access to.** * * API Keys are used to authenticate with [SendGrid's v3 API](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization). * * API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. * * This endpoint returns all the scopes assigned to the key you use to authenticate with it. To retrieve the scopes assigned to another key, you can pass an API key ID to the "Retrieve an existing API key" endpoint. * * For a more detailed explanation of how you can use API Key permissions, please visit our [API Keys documentation](https://sendgrid.com/docs/ui/account-and-settings/api-keys/). */ export const getScopes = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/scopes', }); }; /** * Retrieve access requests * **This endpoint allows you to retrieve a list of all recent access requests.** * * The Response Header's `link` parameter will include pagination info. */ export const getV3ScopesRequests = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/scopes/requests', }); }; /** * Deny access request * **This endpoint allows you to deny an attempt to access your account.** * * **Note:** Only teammate admins may delete a teammate's access request. */ export const deleteV3ScopesRequestsRequestId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteV3ScopesRequestsRequestIdResponse, DeleteV3ScopesRequestsRequestIdError, ThrowOnError >({ ...options, url: '/scopes/requests/{request_id}', }); }; /** * Approve access request * **This endpoint allows you to approve an access attempt.** * * **Note:** Only teammate admins may approve another teammate’s access request. */ export const patchV3ScopesRequestsApproveId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchV3ScopesRequestsApproveIdResponse, PatchV3ScopesRequestsApproveIdError, ThrowOnError >({ ...options, url: '/scopes/requests/{request_id}/approve', }); }; /** * Get all Sender Identities * **This endpoint allows you to retrieve a list of all sender identities that have been created for your account.** */ export const getV3Senders = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/senders', }); }; /** * Create a Sender Identity * **This endpoint allows you to create a new sender identity.** * * You may create up to 100 unique sender identities. */ export const postSenders = (options?: Options) => { return (options?.client ?? client).post({ ...options, url: '/senders', }); }; /** * Delete a Sender Identity * **This endoint allows you to delete one of your sender identities.** */ export const deleteV3SendersSenderId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteV3SendersSenderIdResponse, DeleteV3SendersSenderIdError, ThrowOnError >({ ...options, url: '/senders/{sender_id}', }); }; /** * View a Sender Identity * **This endpoint allows you to retrieve a specific sender identity.** */ export const getV3SendersSenderId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/senders/{sender_id}', }); }; /** * Update a Sender Identity * **This endpoint allows you to update a sender identity.** * * Updates to `from.email` require re-verification. * * Partial updates are allowed, but fields that are marked as "required" in the POST (create) endpoint must not be nil if that field is included in the PATCH request. */ export const patchV3SendersSenderId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/senders/{sender_id}', }); }; /** * Resend Sender Identity Verification * **This enpdoint allows you to resend a sender identity verification email.** */ export const postV3SendersSenderIdResendVerification = ( options: Options, ) => { return (options?.client ?? client).post< PostV3SendersSenderIdResendVerificationResponse, PostV3SendersSenderIdResendVerificationError, ThrowOnError >({ ...options, url: '/senders/{sender_id}/resend_verification', }); }; /** * Create an SSO Certificate * **This endpoint allows you to create an SSO certificate.** */ export const postSsoCertificates = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/sso/certificates', }); }; /** * Delete an SSO Certificate * **This endpoint allows you to delete an SSO certificate.** * * You can retrieve a certificate's ID from the response provided by the "Get All SSO Integrations" endpoint. */ export const deleteSsoCertificatesCertId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSsoCertificatesCertIdResponse, DeleteSsoCertificatesCertIdError, ThrowOnError >({ ...options, url: '/sso/certificates/{cert_id}', }); }; /** * Get an SSO Certificate * **This endpoint allows you to retrieve an individual SSO certificate.** */ export const getSsoCertificatesCertId = ( options: Options, ) => { return (options?.client ?? client).get( { ...options, url: '/sso/certificates/{cert_id}', }, ); }; /** * Update SSO Certificate * **This endpoint allows you to update an existing certificate by ID.** * * You can retrieve a certificate's ID from the response provided by the "Get All SSO Integrations" endpoint. */ export const patchSsoCertificatesCertId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/sso/certificates/{cert_id}', }); }; /** * Get All SSO Integrations * **This endpoint allows you to retrieve all SSO integrations tied to your Twilio SendGrid account.** * * The IDs returned by this endpoint can be used by the APIs additional endpoints to modify your SSO integrations. */ export const getSsoIntegrations = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/sso/integrations', }); }; /** * Create an SSO Integration * **This endpoint allows you to create an SSO integration.** */ export const postSsoIntegrations = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/sso/integrations', }); }; /** * Delete an SSO Integration * **This endpoint allows you to delete an IdP configuration by ID.** * * You can retrieve the IDs for your configurations from the response provided by the "Get All SSO Integrations" endpoint. */ export const deleteSsoIntegrationsId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSsoIntegrationsIdResponse, DeleteSsoIntegrationsIdError, ThrowOnError >({ ...options, url: '/sso/integrations/{id}', }); }; /** * Get an SSO Integration * **This endpoint allows you to retrieve an SSO integration by ID.** * * You can retrieve the IDs for your configurations from the response provided by the "Get All SSO Integrations" endpoint. */ export const getSsoIntegrationsId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/sso/integrations/{id}', }); }; /** * Update an SSO Integration * **This endpoint allows you to modify an exisiting SSO integration.** * * You can retrieve the IDs for your configurations from the response provided by the "Get All SSO Integrations" endpoint. */ export const patchSsoIntegrationsId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/sso/integrations/{id}', }); }; /** * Get All SSO Certificates by Integration * **This endpoint allows you to retrieve all your IdP configurations by configuration ID.** * * The `integration_id` expected by this endpoint is the `id` returned in the response by the "Get All SSO Integrations" endpoint. */ export const getSsoIntegrationsIntegrationIdCertificates = ( options: Options, ) => { return (options?.client ?? client).get< GetSsoIntegrationsIntegrationIdCertificatesResponse, GetSsoIntegrationsIntegrationIdCertificatesError, ThrowOnError >({ ...options, url: '/sso/integrations/{integration_id}/certificates', }); }; /** * Create SSO Teammate * **This endpoint allows you to create an SSO Teammate.** * * The email provided for this user will also function as the Teammate’s username. */ export const postSsoTeammates = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/sso/teammates', }); }; /** * Edit an SSO Teammate * **This endpoint allows you to modify an existing SSO Teammate.** * * To turn a teammate into an admin, the request body should contain the `is_admin` field set to `true`. Otherwise, set `is_admin` to false and pass in all the scopes that a teammate should have. * * Only the parent user and Teammates with admin permissions can update another Teammate’s permissions. Admin users can only update permissions. */ export const patchSsoTeammatesUsername = ( options: Options, ) => { return (options?.client ?? client).patch< PatchSsoTeammatesUsernameResponse, PatchSsoTeammatesUsernameError, ThrowOnError >({ ...options, url: '/sso/teammates/{username}', }); }; /** * Retrieve global email statistics * **This endpoint allows you to retrieve all of your global email statistics between a given date range.** * * Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats. */ export const getStats = (options: Options) => { return (options?.client ?? client).get({ ...options, url: '/stats', }); }; /** * List all Subusers * **This endpoint allows you to retrieve a list of all of your subusers.** * * You can choose to retrieve specific subusers as well as limit the results that come back from the API. */ export const getSubusers = (options?: Options) => { return (options?.client ?? client).get({ ...options, url: '/subusers', }); }; /** * Create Subuser * **This endpoint allows you to create a new subuser.** */ export const postSubusers = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/subusers', }); }; /** * Retrieve Subuser Reputations * **This endpoint allows you to request the reputations for your subusers.** * * Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will affect your sender rating. */ export const getSubusersReputations = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/subusers/reputations', }); }; /** * Retrieve email statistics for your subusers. * **This endpoint allows you to retrieve the email statistics for the given subusers.** * * You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser. */ export const getSubusersStats = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/subusers/stats', }); }; /** * Retrieve monthly stats for all subusers * **This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.** * * When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: * `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. */ export const getSubusersStatsMonthly = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/subusers/stats/monthly', }); }; /** * Retrieve the totals for each email statistic metric for all subusers. * **This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.** */ export const getSubusersStatsSums = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/subusers/stats/sums', }); }; /** * Delete a subuser * **This endpoint allows you to delete a subuser.** * * This is a permanent action. Once deleted, a subuser cannot be retrieved. */ export const deleteSubusersSubuserName = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSubusersSubuserNameResponse, DeleteSubusersSubuserNameError, ThrowOnError >({ ...options, url: '/subusers/{subuser_name}', }); }; /** * Enable/disable a subuser * **This endpoint allows you to enable or disable a subuser.** */ export const patchSubusersSubuserName = ( options: Options, ) => { return (options?.client ?? client).patch< PatchSubusersSubuserNameResponse, PatchSubusersSubuserNameError, ThrowOnError >({ ...options, url: '/subusers/{subuser_name}', }); }; /** * Update IPs assigned to a subuser * **This endpoint allows you update your subusers' assigned IP.** * * Each subuser should be assigned to an IP address from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have one or more of their own IP addresses as well. * * More information: * * * [How to request more IPs](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) * * [Setup Reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) */ export const putSubusersSubuserNameIps = ( options: Options, ) => { return (options?.client ?? client).put< PutSubusersSubuserNameIpsResponse, PutSubusersSubuserNameIpsError, ThrowOnError >({ ...options, url: '/subusers/{subuser_name}/ips', }); }; /** * Delete monitor settings */ export const deleteSubusersSubuserNameMonitor = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSubusersSubuserNameMonitorResponse, DeleteSubusersSubuserNameMonitorError, ThrowOnError >({ ...options, url: '/subusers/{subuser_name}/monitor', }); }; /** * Retrieve monitor settings for a subuser */ export const getSubusersSubuserNameMonitor = ( options: Options, ) => { return (options?.client ?? client).get< GetSubusersSubuserNameMonitorResponse, GetSubusersSubuserNameMonitorError, ThrowOnError >({ ...options, url: '/subusers/{subuser_name}/monitor', }); }; /** * Create monitor settings */ export const postSubusersSubuserNameMonitor = ( options: Options, ) => { return (options?.client ?? client).post< PostSubusersSubuserNameMonitorResponse, PostSubusersSubuserNameMonitorError, ThrowOnError >({ ...options, url: '/subusers/{subuser_name}/monitor', }); }; /** * Update Monitor Settings for a subuser */ export const putSubusersSubuserNameMonitor = ( options: Options, ) => { return (options?.client ?? client).put< PutSubusersSubuserNameMonitorResponse, PutSubusersSubuserNameMonitorError, ThrowOnError >({ ...options, url: '/subusers/{subuser_name}/monitor', }); }; /** * Retrieve the monthly email statistics for a single subuser * **This endpoint allows you to retrive the monthly email statistics for a specific subuser.** * * When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: * `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. */ export const getSubusersSubuserNameStatsMonthly = ( options: Options, ) => { return (options?.client ?? client).get< GetSubusersSubuserNameStatsMonthlyResponse, GetSubusersSubuserNameStatsMonthlyError, ThrowOnError >({ ...options, url: '/subusers/{subuser_name}/stats/monthly', }); }; /** * Delete blocks * **This endpoint allows you to delete all email addresses on your blocks list.** * * There are two options for deleting blocked emails: * * 1. You can delete all blocked emails by setting `delete_all` to `true` in the request body. * 2. You can delete a selection of blocked emails by specifying the email addresses in the `emails` array of the request body. */ export const deleteSuppressionBlocks = ( options?: Options, ) => { return (options?.client ?? client).delete< DeleteSuppressionBlocksResponse, DeleteSuppressionBlocksError, ThrowOnError >({ ...options, url: '/suppression/blocks', }); }; /** * Retrieve all blocks * **This endpoint allows you to retrieve all email addresses that are currently on your blocks list.** */ export const getSuppressionBlocks = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/suppression/blocks', }); }; /** * Delete a specific block * **This endpoint allows you to delete a specific email address from your blocks list.** */ export const deleteSuppressionBlocksEmail = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSuppressionBlocksEmailResponse, DeleteSuppressionBlocksEmailError, ThrowOnError >({ ...options, url: '/suppression/blocks/{email}', }); }; /** * Retrieve a specific block * **This endpoint allows you to retrieve a specific email address from your blocks list.** */ export const getSuppressionBlocksEmail = ( options: Options, ) => { return (options?.client ?? client).get< GetSuppressionBlocksEmailResponse, GetSuppressionBlocksEmailError, ThrowOnError >({ ...options, url: '/suppression/blocks/{email}', }); }; /** * Delete bounces * **This endpoint allows you to delete all emails on your bounces list.** * * There are two options for deleting bounced emails: * * 1. You can delete all bounced emails by setting `delete_all` to `true` in the request body. * 2. You can delete a selection of bounced emails by specifying the email addresses in the `emails` array of the request body. */ export const deleteSuppressionBounces = ( options?: Options, ) => { return (options?.client ?? client).delete< DeleteSuppressionBouncesResponse, DeleteSuppressionBouncesError, ThrowOnError >({ ...options, url: '/suppression/bounces', }); }; /** * Retrieve all bounces * **This endpoint allows you to retrieve all of your bounces.** */ export const getSuppressionBounces = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/suppression/bounces', }); }; /** * Delete a bounce * **This endpoint allows you to remove an email address from your bounce list.** */ export const deleteSuppressionBouncesEmail = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSuppressionBouncesEmailResponse, DeleteSuppressionBouncesEmailError, ThrowOnError >({ ...options, url: '/suppression/bounces/{email}', } as any); }; /** * Retrieve a Bounce * **This endpoint allows you to retrieve a specific bounce by email address.** */ export const getSuppressionBouncesEmail = ( options: Options, ) => { return (options?.client ?? client).get< GetSuppressionBouncesEmailResponse, GetSuppressionBouncesEmailError, ThrowOnError >({ ...options, url: '/suppression/bounces/{email}', }); }; /** * Delete invalid emails * **This endpoint allows you to remove email addresses from your invalid email address list.** * * There are two options for deleting invalid email addresses: * * 1) You can delete all invalid email addresses by setting `delete_all` to true in the request body. * 2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body. */ export const deleteSuppressionInvalidEmails = ( options?: Options, ) => { return (options?.client ?? client).delete< DeleteSuppressionInvalidEmailsResponse, DeleteSuppressionInvalidEmailsError, ThrowOnError >({ ...options, url: '/suppression/invalid_emails', }); }; /** * Retrieve all invalid emails * **This endpoint allows you to retrieve a list of all invalid email addresses.** */ export const getSuppressionInvalidEmails = ( options?: Options, ) => { return (options?.client ?? client).get< GetSuppressionInvalidEmailsResponse, GetSuppressionInvalidEmailsError, ThrowOnError >({ ...options, url: '/suppression/invalid_emails', }); }; /** * Delete a specific invalid email * **This endpoint allows you to remove a specific email address from the invalid email address list.** */ export const deleteSuppressionInvalidEmailsEmail = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSuppressionInvalidEmailsEmailResponse, DeleteSuppressionInvalidEmailsEmailError, ThrowOnError >({ ...options, url: '/suppression/invalid_emails/{email}', }); }; /** * Retrieve a specific invalid email * **This endpoint allows you to retrieve a specific invalid email addresses.** */ export const getSuppressionInvalidEmailsEmail = ( options: Options, ) => { return (options?.client ?? client).get< GetSuppressionInvalidEmailsEmailResponse, GetSuppressionInvalidEmailsEmailError, ThrowOnError >({ ...options, url: '/suppression/invalid_emails/{email}', }); }; /** * Delete spam reports * **This endpoint allows you to delete your spam reports.** * * Deleting a spam report will remove the suppression, meaning email will once again be sent to the previously suppressed address. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required. * * There are two options for deleting spam reports: * * 1. You can delete all spam reports by setting the `delete_all` field to `true` in the request body. * 2. You can delete a list of select spam reports by specifying the email addresses in the `emails` array of the request body. */ export const deleteSuppressionSpamReports = ( options?: Options, ) => { return (options?.client ?? client).delete< DeleteSuppressionSpamReportsResponse, DeleteSuppressionSpamReportsError, ThrowOnError >({ ...options, url: '/suppression/spam_reports', }); }; /** * Retrieve all spam reports * **This endpoint allows you to retrieve all spam reports.** */ export const getSuppressionSpamReports = ( options?: Options, ) => { return (options?.client ?? client).get< GetSuppressionSpamReportsResponse, GetSuppressionSpamReportsError, ThrowOnError >({ ...options, url: '/suppression/spam_reports', }); }; /** * Delete a specific spam report * **This endpoint allows you to delete a specific spam report by email address.** * * Deleting a spam report will remove the suppression, meaning email will once again be sent to the previously suppressed address. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required. */ export const deleteSuppressionSpamReportsEmail = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteSuppressionSpamReportsEmailResponse, DeleteSuppressionSpamReportsEmailError, ThrowOnError >({ ...options, url: '/suppression/spam_reports/{email}', }); }; /** * Retrieve a specific spam report * **This endpoint allows you to retrieve a specific spam report by email address.** */ export const getSuppressionSpamReportsEmail = ( options: Options, ) => { return (options?.client ?? client).get< GetSuppressionSpamReportsEmailResponse, GetSuppressionSpamReportsEmailError, ThrowOnError >({ ...options, url: '/suppression/spam_reports/{email}', }); }; /** * Retrieve all global suppressions * **This endpoint allows you to retrieve a list of all email address that are globally suppressed.** */ export const getSuppressionUnsubscribes = ( options?: Options, ) => { return (options?.client ?? client).get< GetSuppressionUnsubscribesResponse, GetSuppressionUnsubscribesError, ThrowOnError >({ ...options, url: '/suppression/unsubscribes', }); }; /** * Retrieve all teammates * **This endpoint allows you to retrieve a list of all current Teammates.** * * You can limit the number of results returned using the `limit` query paramater. To return results from a specific Teammate, use the `offset` paramter. The Response Headers will include pagination info. */ export const getV3Teammates = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/teammates', }); }; /** * Invite teammate * **This endpoint allows you to invite a Teammate to your account via email.** * * You can set a Teammate's initial permissions using the `scopes` array in the request body. Teammate's will receive a minimum set of scopes from Twilio SendGrid that are necessary for the Teammate to function. * * **Note:** A teammate invite will expire after 7 days, but you may resend the invitation at any time to reset the expiration date. */ export const postV3Teammates = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/teammates', }); }; /** * Retrieve all pending teammates * **This endpoint allows you to retrieve a list of all pending Teammate invitations.** * * Each teammate invitation is valid for 7 days. Users may resend the invitation to refresh the expiration date. */ export const getV3TeammatesPending = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/teammates/pending', }); }; /** * Delete pending teammate * **This endpoint allows you to delete a pending teammate invite.** */ export const deleteV3TeammatesPendingToken = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteV3TeammatesPendingTokenResponse, DeleteV3TeammatesPendingTokenError, ThrowOnError >({ ...options, url: '/teammates/pending/{token}', }); }; /** * Resend teammate invite * **This endpoint allows you to resend a Teammate invitation.** * * Teammate invitations will expire after 7 days. Resending an invitation will reset the expiration date. */ export const postV3TeammatesPendingTokenResend = ( options: Options, ) => { return (options?.client ?? client).post< PostV3TeammatesPendingTokenResendResponse, PostV3TeammatesPendingTokenResendError, ThrowOnError >({ ...options, url: '/teammates/pending/{token}/resend', }); }; /** * Delete teammate * **This endpoint allows you to delete a teammate.** * * **Only the parent user or an admin teammate can delete another teammate.** */ export const deleteV3TeammatesUsername = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteV3TeammatesUsernameResponse, DeleteV3TeammatesUsernameError, ThrowOnError >({ ...options, url: '/teammates/{username}', }); }; /** * Retrieve specific teammate * **This endpoint allows you to retrieve a specific Teammate by username.** * * You can retrieve the username's for each of your Teammates using the "Retrieve all Teammates" endpoint. */ export const getV3TeammatesUsername = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/teammates/{username}', }); }; /** * Update teammate's permissions * **This endpoint allows you to update a teammate’s permissions.** * * To turn a teammate into an admin, the request body should contain an `is_admin` set to `true`. Otherwise, set `is_admin` to `false` and pass in all the scopes that a teammate should have. * * **Only the parent user or other admin teammates can update another teammate’s permissions.** * * **Admin users can only update permissions.** */ export const patchV3TeammatesUsername = ( options: Options, ) => { return (options?.client ?? client).patch< PatchV3TeammatesUsernameResponse, PatchV3TeammatesUsernameError, ThrowOnError >({ ...options, url: '/teammates/{username}', }); }; /** * Retrieve paged transactional templates. * **This endpoint allows you to retrieve all transactional templates.** */ export const getTemplates = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/templates', }); }; /** * Create a transactional template. * **This endpoint allows you to create a transactional template.** */ export const postTemplates = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/templates', }); }; /** * Delete a template. * **This endpoint allows you to delete a transactional template.** */ export const deleteTemplatesTemplateId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteTemplatesTemplateIdResponse, DeleteTemplatesTemplateIdError, ThrowOnError >({ ...options, url: '/templates/{template_id}', }); }; /** * Retrieve a single transactional template. * **This endpoint allows you to retrieve a single transactional template.** */ export const getTemplatesTemplateId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/templates/{template_id}', }); }; /** * Edit a transactional template. * **This endpoint allows you to edit the name of a transactional template.** * * To edit the template itself, [create a new transactional template version](https://sendgrid.api-docs.io/v3.0/transactional-templates-versions/create-a-new-transactional-template-version). */ export const patchTemplatesTemplateId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchTemplatesTemplateIdResponse, PatchTemplatesTemplateIdError, ThrowOnError >({ ...options, url: '/templates/{template_id}', }); }; /** * Duplicate a transactional template. * **This endpoint allows you to duplicate a transactional template.** */ export const postTemplatesTemplateId = ( options: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/templates/{template_id}', }); }; /** * Create a new transactional template version. * **This endpoint allows you to create a new version of a template.** */ export const postTemplatesTemplateIdVersions = ( options: Options, ) => { return (options?.client ?? client).post< PostTemplatesTemplateIdVersionsResponse, PostTemplatesTemplateIdVersionsError, ThrowOnError >({ ...options, url: '/templates/{template_id}/versions', }); }; /** * Delete a transactional template version. * **This endpoint allows you to delete a transactional template version.** */ export const deleteTemplatesTemplateIdVersionsVersionId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteTemplatesTemplateIdVersionsVersionIdResponse, DeleteTemplatesTemplateIdVersionsVersionIdError, ThrowOnError >({ ...options, url: '/templates/{template_id}/versions/{version_id}', }); }; /** * Retrieve a specific transactional template version. * **This endpoint allows you to retrieve a specific version of a template.** */ export const getTemplatesTemplateIdVersionsVersionId = ( options: Options, ) => { return (options?.client ?? client).get< GetTemplatesTemplateIdVersionsVersionIdResponse, GetTemplatesTemplateIdVersionsVersionIdError, ThrowOnError >({ ...options, url: '/templates/{template_id}/versions/{version_id}', }); }; /** * Edit a transactional template version. * **This endpoint allows you to edit the content of your template version.** */ export const patchTemplatesTemplateIdVersionsVersionId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchTemplatesTemplateIdVersionsVersionIdResponse, PatchTemplatesTemplateIdVersionsVersionIdError, ThrowOnError >({ ...options, url: '/templates/{template_id}/versions/{version_id}', }); }; /** * Activate a transactional template version. * **This endpoint allows you to activate a version of one of your templates.** */ export const postTemplatesTemplateIdVersionsVersionIdActivate = ( options: Options, ) => { return (options?.client ?? client).post< PostTemplatesTemplateIdVersionsVersionIdActivateResponse, PostTemplatesTemplateIdVersionsVersionIdActivateError, ThrowOnError >({ ...options, url: '/templates/{template_id}/versions/{version_id}/activate', }); }; /** * Retrieve Tracking Settings * **This endpoint allows you to retrieve a list of all tracking settings on your account.** */ export const getTrackingSettings = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/tracking_settings', }); }; /** * Retrieve Click Track Settings * **This endpoint allows you to retrieve your current click tracking setting.** * * Click Tracking overrides all the links and URLs in your emails and points them to either SendGrid’s servers or the domain with which you branded your link. When a customer clicks a link, SendGrid tracks those [clicks](https://sendgrid.com/docs/glossary/clicks/). * * Click tracking helps you understand how users are engaging with your communications. SendGrid can track up to 1000 links per email */ export const getTrackingSettingsClick = ( options?: Options, ) => { return (options?.client ?? client).get( { ...options, url: '/tracking_settings/click', }, ); }; /** * Update Click Tracking Settings * **This endpoint allows you to enable or disable your current click tracking setting.** * * Click Tracking overrides all the links and URLs in your emails and points them to either SendGrid’s servers or the domain with which you branded your link. When a customer clicks a link, SendGrid tracks those [clicks](https://sendgrid.com/docs/glossary/clicks/). * * Click tracking helps you understand how users are engaging with your communications. SendGrid can track up to 1000 links per email */ export const patchTrackingSettingsClick = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchTrackingSettingsClickResponse, PatchTrackingSettingsClickError, ThrowOnError >({ ...options, url: '/tracking_settings/click', }); }; /** * Retrieve Google Analytics Settings * **This endpoint allows you to retrieve your current setting for Google Analytics.** * * * Google Analytics helps you understand how users got to your site and what they're doing there. For more information about using Google Analytics, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). * * We default the settings to Google’s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/ui/analytics-and-reporting/google-analytics/). */ export const getTrackingSettingsGoogleAnalytics = ( options?: Options, ) => { return (options?.client ?? client).get< GetTrackingSettingsGoogleAnalyticsResponse, GetTrackingSettingsGoogleAnalyticsError, ThrowOnError >({ ...options, url: '/tracking_settings/google_analytics', }); }; /** * Update Google Analytics Settings * **This endpoint allows you to update your current setting for Google Analytics.** * * Google Analytics helps you understand how users got to your site and what they're doing there. For more information about using Google Analytics, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). * * We default the settings to Google’s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/ui/analytics-and-reporting/google-analytics/). */ export const patchTrackingSettingsGoogleAnalytics = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchTrackingSettingsGoogleAnalyticsResponse, PatchTrackingSettingsGoogleAnalyticsError, ThrowOnError >({ ...options, url: '/tracking_settings/google_analytics', }); }; /** * Get Open Tracking Settings * **This endpoint allows you to retrieve your current settings for open tracking.** * * Open Tracking adds an invisible image at the end of the email which can track email opens. * * If the email recipient has images enabled on their email client, a request to SendGrid’s server for the invisible image is executed and an open event is logged. * * These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. */ export const getTrackingSettingsOpen = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/tracking_settings/open', }); }; /** * Update Open Tracking Settings * **This endpoint allows you to update your current settings for open tracking.** * * Open Tracking adds an invisible image at the end of the email which can track email opens. * * If the email recipient has images enabled on their email client, a request to SendGrid’s server for the invisible image is executed and an open event is logged. * * These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. */ export const patchTrackingSettingsOpen = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchTrackingSettingsOpenResponse, PatchTrackingSettingsOpenError, ThrowOnError >({ ...options, url: '/tracking_settings/open', }); }; /** * Retrieve Subscription Tracking Settings * **This endpoint allows you to retrieve your current settings for subscription tracking.** * * Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. */ export const getTrackingSettingsSubscription = ( options?: Options, ) => { return (options?.client ?? client).get< GetTrackingSettingsSubscriptionResponse, GetTrackingSettingsSubscriptionError, ThrowOnError >({ ...options, url: '/tracking_settings/subscription', }); }; /** * Update Subscription Tracking Settings * **This endpoint allows you to update your current settings for subscription tracking.** * * Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. */ export const patchTrackingSettingsSubscription = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchTrackingSettingsSubscriptionResponse, PatchTrackingSettingsSubscriptionError, ThrowOnError >({ ...options, url: '/tracking_settings/subscription', }); }; /** * Get a user's account information. * **This endpoint allows you to retrieve your user account details.** * * Your user's account information includes the user's account type and reputation. */ export const getUserAccount = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/user/account', }); }; /** * Retrieve your credit balance * **This endpoint allows you to retrieve the current credit balance for your account.** * * Each account has a credit balance, which is a base number of emails it can send before receiving per-email charges. For more information about credits and billing, see [Billing and Plan details information](https://sendgrid.com/docs/ui/account-and-settings/billing/). */ export const getUserCredits = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/user/credits', }); }; /** * Retrieve your account email address * **This endpoint allows you to retrieve the email address currently on file for your account.** */ export const getUserEmail = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/user/email', }); }; /** * Update your account email address * **This endpoint allows you to update the email address currently on file for your account.** */ export const putUserEmail = ( options?: Options, ) => { return (options?.client ?? client).put({ ...options, url: '/user/email', }); }; /** * Update your password * **This endpoint allows you to update your password.** */ export const putUserPassword = ( options?: Options, ) => { return (options?.client ?? client).put({ ...options, url: '/user/password', }); }; /** * Get a user's profile */ export const getUserProfile = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/user/profile', }); }; /** * Update a user's profile * **This endpoint allows you to update your current profile details.** * * Any one or more of the parameters can be updated via the PATCH `/user/profile` endpoint. You must include at least one when you PATCH. */ export const patchUserProfile = ( options?: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/user/profile', }); }; /** * Retrieve all scheduled sends * **This endpoint allows you to retrieve all cancelled and paused scheduled send information.** * * This endpoint will return only the scheduled sends that are associated with a `batch_id`. If you have scheduled a send using the `/mail/send` endpoint and the `send_at` field but no `batch_id`, the send will be scheduled for delivery; however, it will not be returned by this endpoint. For this reason, you should assign a `batch_id` to any scheduled send you may need to pause or cancel in the future. */ export const getUserScheduledSends = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/user/scheduled_sends', }); }; /** * Cancel or pause a scheduled send * **This endpoint allows you to cancel or pause a scheduled send associated with a `batch_id`.** * * Passing this endpoint a `batch_id` and status will cancel or pause the scheduled send. * * Once a scheduled send is set to `pause` or `cancel` you must use the "Update a scheduled send" endpoint to change its status or the "Delete a cancellation or pause from a scheduled send" endpoint to remove the status. Passing a status change to a scheduled send that has already been paused or cancelled will result in a `400` level status code. * * If the maximum number of cancellations/pauses are added to a send, a `400` level status code will be returned. */ export const postUserScheduledSends = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/user/scheduled_sends', }); }; /** * Delete a cancellation or pause from a scheduled send * **This endpoint allows you to delete the cancellation/pause of a scheduled send.** * * Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. */ export const deleteUserScheduledSendsBatchId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteUserScheduledSendsBatchIdResponse, DeleteUserScheduledSendsBatchIdError, ThrowOnError >({ ...options, url: '/user/scheduled_sends/{batch_id}', }); }; /** * Retrieve scheduled send * **This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** */ export const getUserScheduledSendsBatchId = ( options: Options, ) => { return (options?.client ?? client).get< GetUserScheduledSendsBatchIdResponse, GetUserScheduledSendsBatchIdError, ThrowOnError >({ ...options, url: '/user/scheduled_sends/{batch_id}', }); }; /** * Update a scheduled send * **This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** * * If you have already set a `cancel` or `pause` status on a scheduled send using the "Cancel or pause a scheduled send" endpoint, you can update it's status using this endpoint. Attempting to update a status once it has been set with the "Cancel or pause a scheduled send" endpoint will result in a `400` error. */ export const patchUserScheduledSendsBatchId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchUserScheduledSendsBatchIdResponse, PatchUserScheduledSendsBatchIdError, ThrowOnError >({ ...options, url: '/user/scheduled_sends/{batch_id}', }); }; /** * Retrieve current Enforced TLS settings. * **This endpoint allows you to retrieve your current Enforced TLS settings.** * * The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. * * If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description. */ export const getUserSettingsEnforcedTls = ( options?: Options, ) => { return (options?.client ?? client).get< GetUserSettingsEnforcedTlsResponse, GetUserSettingsEnforcedTlsError, ThrowOnError >({ ...options, url: '/user/settings/enforced_tls', }); }; /** * Update Enforced TLS settings * **This endpoint allows you to update your Enforced TLS settings.** * * To require TLS from recipients, set `require_tls` to `true`. If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description. * * > Twilio SendGrid supports TLS 1.1 and higher and does not support older versions of TLS due to security vulnerabilities. */ export const patchUserSettingsEnforcedTls = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchUserSettingsEnforcedTlsResponse, PatchUserSettingsEnforcedTlsError, ThrowOnError >({ ...options, url: '/user/settings/enforced_tls', }); }; /** * Retrieve your username * **This endpoint allows you to retrieve your current account username.** */ export const getUserUsername = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/user/username', }); }; /** * Update your username * **This endpoint allows you to update the username for your account.** */ export const putUserUsername = ( options?: Options, ) => { return (options?.client ?? client).put({ ...options, url: '/user/username', }); }; /** * Retrieve Event Webhook settings * **This endpoint allows you to retrieve your current event webhook settings.** * * If an event type is marked as `true`, then the event webhook will include information about that event. * * SendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. * * Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. */ export const getUserWebhooksEventSettings = ( options?: Options, ) => { return (options?.client ?? client).get< GetUserWebhooksEventSettingsResponse, GetUserWebhooksEventSettingsError, ThrowOnError >({ ...options, url: '/user/webhooks/event/settings', }); }; /** * Update Event Notification Settings * **This endpoint allows you to update your current event webhook settings.** * * If an event type is marked as `true`, then the event webhook will include information about that event. * * SendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. * * Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. */ export const patchUserWebhooksEventSettings = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchUserWebhooksEventSettingsResponse, PatchUserWebhooksEventSettingsError, ThrowOnError >({ ...options, url: '/user/webhooks/event/settings', }); }; /** * Retrieve Signed Webhook Public Key * **This endpoint allows you to retrieve your signed webhook's public key.** * * Once you have enabled signing of the Event Webhook, you will need the public key provided to verify the signatures on requests coming from Twilio SendGrid. You can retrieve the public key from this endpoint at any time. * * For more information about cryptographically signing the Event Webhook, see [Getting Started with the Event Webhook Security Features](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features). */ export const getUserWebhooksEventSettingsSigned = ( options?: Options, ) => { return (options?.client ?? client).get< GetUserWebhooksEventSettingsSignedResponse, GetUserWebhooksEventSettingsSignedError, ThrowOnError >({ ...options, url: '/user/webhooks/event/settings/signed', }); }; /** * Enable/Disable Signed Webhook * **This endpoint allows you to enable or disable signing of the Event Webhook.** * * This endpoint takes a single boolean request parameter, `enabled`. You may either enable or disable signing of the Event Webhook using this endpoint. Once enabled, you can retrieve your public key using the `/webhooks/event/settings/signed` endpoint. * * For more information about cryptographically signing the Event Webhook, see [Getting Started with the Event Webhook Security Features](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features). */ export const patchUserWebhooksEventSettingsSigned = ( options?: Options, ) => { return (options?.client ?? client).patch< PatchUserWebhooksEventSettingsSignedResponse, PatchUserWebhooksEventSettingsSignedError, ThrowOnError >({ ...options, url: '/user/webhooks/event/settings/signed', }); }; /** * Test Event Notification Settings * **This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.** * * SendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. * * Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. * * >**Tip**: Retry logic for this endpoint differs from other endpoints, which use a rolling 24-hour retry. * * If your web server does not return a 2xx response type, we will retry a POST request until we receive a 2xx response or the maximum time of 10 minutes has expired. */ export const postUserWebhooksEventTest = ( options?: Options, ) => { return (options?.client ?? client).post< PostUserWebhooksEventTestResponse, PostUserWebhooksEventTestError, ThrowOnError >({ ...options, url: '/user/webhooks/event/test', }); }; /** * Retrieve all parse settings * **This endpoint allows you to retrieve all of your current inbound parse settings.** */ export const getUserWebhooksParseSettings = ( options?: Options, ) => { return (options?.client ?? client).get< GetUserWebhooksParseSettingsResponse, GetUserWebhooksParseSettingsError, ThrowOnError >({ ...options, url: '/user/webhooks/parse/settings', }); }; /** * Create a parse setting * **This endpoint allows you to create a new inbound parse setting.** * * Creating an Inbound Parse setting requires two pieces of information: a `url` and a `hostname`. * * The `hostname` must correspond to a domain authenticated by Twilio SendGrid on your account. If you need to complete domain authentication, you can use the [Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth) or the "Authenticate a domain" endpoint. See "[How to Set Up Domain Authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)" for instructions. * * Any email received by the `hostname` will be parsed when you complete this setup. You must also add a Twilio SendGrid MX record to this domain's DNS records. See "[Setting up the Inbound Parse Webhook](https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/)" for full instructions. * * The `url` represents a location where the parsed message data will be delivered. Twilio SendGrid will make an HTTP POST request to this `url` with the message data. The `url` must be publicly reachable, and your application must return a `200` status code to signal that the message data has been received. */ export const postUserWebhooksParseSettings = ( options?: Options, ) => { return (options?.client ?? client).post< PostUserWebhooksParseSettingsResponse, PostUserWebhooksParseSettingsError, ThrowOnError >({ ...options, url: '/user/webhooks/parse/settings', }); }; /** * Delete a parse setting * **This endpoint allows you to delete a specific inbound parse setting by hostname.** * * You can retrieve all your Inbound Parse settings and their associated host names with the "Retrieve all parse settings" endpoint. */ export const deleteUserWebhooksParseSettingsHostname = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteUserWebhooksParseSettingsHostnameResponse, DeleteUserWebhooksParseSettingsHostnameError, ThrowOnError >({ ...options, url: '/user/webhooks/parse/settings/{hostname}', }); }; /** * Retrieve a specific parse setting * **This endpoint allows you to retrieve a specific inbound parse setting by hostname.** * * You can retrieve all your Inbound Parse settings and their associated host names with the "Retrieve all parse settings" endpoint. */ export const getUserWebhooksParseSettingsHostname = ( options: Options, ) => { return (options?.client ?? client).get< GetUserWebhooksParseSettingsHostnameResponse, GetUserWebhooksParseSettingsHostnameError, ThrowOnError >({ ...options, url: '/user/webhooks/parse/settings/{hostname}', }); }; /** * Update a parse setting * **This endpoint allows you to update a specific inbound parse setting by hostname.** * * You can retrieve all your Inbound Parse settings and their associated host names with the "Retrieve all parse settings" endpoint. */ export const patchUserWebhooksParseSettingsHostname = ( options: Options, ) => { return (options?.client ?? client).patch< PatchUserWebhooksParseSettingsHostnameResponse, PatchUserWebhooksParseSettingsHostnameError, ThrowOnError >({ ...options, url: '/user/webhooks/parse/settings/{hostname}', }); }; /** * Retrieves Inbound Parse Webhook statistics. * **This endpoint allows you to retrieve the statistics for your Parse Webhook useage.** * * SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incomming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 30MB in size, including all attachments. * * There are a number of pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries). */ export const getUserWebhooksParseStats = ( options: Options, ) => { return (options?.client ?? client).get< GetUserWebhooksParseStatsResponse, GetUserWebhooksParseStatsError, ThrowOnError >({ ...options, url: '/user/webhooks/parse/stats', }); }; /** * Validate an email * **This endpoint allows you to validate an email address.** */ export const postValidationsEmail = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/validations/email', }); }; /** * Get All Verified Senders * **This endpoint allows you to retrieve all the Sender Identities associated with an account.** * * This endpoint will return both verified and unverified senders. * * You can limit the number of results returned using the `limit`, `lastSeenID`, and `id` query string parameters. * * * `limit` allows you to specify an exact number of Sender Identities to return. * * `lastSeenID` will return senders with an ID number occuring after the passed in ID. In other words, the `lastSeenID` provides a starting point from which SendGrid will iterate to find Sender Identities associated with your account. * * `id` will return information about only the Sender Identity passed in the request. */ export const getVerifiedSenders = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/verified_senders', }); }; /** * Create Verified Sender Request * **This endpoint allows you to create a new Sender Identify**. * * Upon successful submission of a `POST` request to this endpoint, an identity will be created, and a verification email will be sent to the address assigned to the `from_email` field. You must complete the verification process using the sent email to fully verify the sender. * * If you need to resend the verification email, you can do so with the Resend Verified Sender Request, `/resend/{id}`, endpoint. * * If you need to authenticate a domain rather than a Single Sender, see the [Domain Authentication API](https://sendgrid.api-docs.io/v3.0/domain-authentication/authenticate-a-domain). */ export const postVerifiedSenders = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/verified_senders', }); }; /** * Domain Warn List * **This endpoint returns a list of domains known to implement DMARC and categorizes them by failure type — hard failure or soft failure**. * * Domains listed as hard failures will not deliver mail when used as a [Sender Identity](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/) due to the domain's DMARC policy settings. * * For example, using a `yahoo.com` email address as a Sender Identity will likely result in the rejection of your mail. For more information about DMARC, see [Everything about DMARC](https://sendgrid.com/docs/ui/sending-email/dmarc/). */ export const getVerifiedSendersDomains = ( options?: Options, ) => { return (options?.client ?? client).get< GetVerifiedSendersDomainsResponse, GetVerifiedSendersDomainsError, ThrowOnError >({ ...options, url: '/verified_senders/domains', }); }; /** * Resend Verified Sender Request * **This endpoint allows you to resend a verification email to a specified Sender Identity**. * * Passing the `id` assigned to a Sender Identity to this endpoint will resend a verification email to the `from_address` associated with the Sender Identity. This can be useful if someone loses their verification email or needs to have it resent for any other reason. * * You can retrieve the IDs associated with Sender Identities by passing a "Get All Verified Senders" endpoint. */ export const postVerifiedSendersResendId = ( options: Options, ) => { return (options?.client ?? client).post< PostVerifiedSendersResendIdResponse, PostVerifiedSendersResendIdError, ThrowOnError >({ ...options, url: '/verified_senders/resend/{id}', }); }; /** * Completed Steps * **This endpoint allows you to determine which of SendGrid’s verification processes have been completed for an account**. * * This endpoint returns boolean values, `true` and `false`, for [Domain Authentication](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/#domain-authentication), `domain_verified`, and [Single Sender Verification](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/#single-sender-verification), `sender_verified`, for the account. * * An account may have one, both, or neither verification steps completed. If you need to authenticate a domain rather than a Single Sender, see the "Authenticate a domain" endpoint. */ export const getVerifiedSendersStepsCompleted = ( options?: Options, ) => { return (options?.client ?? client).get< GetVerifiedSendersStepsCompletedResponse, GetVerifiedSendersStepsCompletedError, ThrowOnError >({ ...options, url: '/verified_senders/steps_completed', }); }; /** * Verify Sender Request * **This endpoint allows you to verify a sender requests.** * * The token is generated by SendGrid and included in a verification email delivered to the address that's pending verification. */ export const getVerifiedSendersVerifyToken = ( options: Options, ) => { return (options?.client ?? client).get< GetVerifiedSendersVerifyTokenResponse, GetVerifiedSendersVerifyTokenError, ThrowOnError >({ ...options, url: '/verified_senders/verify/{token}', }); }; /** * Delete Verified Sender * **This endpoint allows you to delete a Sender Identity**. * * Pass the `id` assigned to a Sender Identity to this endpoint to delete the Sender Identity from your account. * * You can retrieve the IDs associated with Sender Identities using the "Get All Verified Senders" endpoint. */ export const deleteVerifiedSendersId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteVerifiedSendersIdResponse, DeleteVerifiedSendersIdError, ThrowOnError >({ ...options, url: '/verified_senders/{id}', }); }; /** * Edit Verified Sender * **This endpoint allows you to update an existing Sender Identity**. * * Pass the `id` assigned to a Sender Identity to this endpoint as a path parameter. Include any fields you wish to update in the request body in JSON format. * * You can retrieve the IDs associated with Sender Identities by passing a `GET` request to the Get All Verified Senders endpoint, `/verified_senders`. * * **Note:** Unlike a `PUT` request, `PATCH` allows you to update only the fields you wish to edit. Fields that are not passed as part of a request will remain unaltered. */ export const patchVerifiedSendersId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/verified_senders/{id}', }); }; /** * Email DNS records to a co-worker * **This endpoint is used to share DNS records with a colleagues** * * Use this endpoint to send SendGrid-generated DNS record information to a co-worker so they can enter it into your DNS provider to validate your domain and link branding. * * What type of records are sent will depend on whether you have chosen Automated Security or not. When using Automated Security, SendGrid provides you with three CNAME records. If you turn Automated Security off, you are instead given TXT and MX records. * * If you pass a `link_id` to this endpoint, the generated email will supply the DNS records necessary to complete [Link Branding](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) setup. If you pass a `domain_id` to this endpoint, the generated email will supply the DNS records needed to complete [Domain Authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Passing both IDs will generate an email with the records needed to complete both setup steps. * * You can retrieve all your domain IDs from the returned `id` fields for each domain using the "List all authenticated domains" endpoint. You can retrieve all of your link IDs using the "Retrieve all branded links" endpoint. */ export const postWhitelabelDnsEmail = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/whitelabel/dns/email', }); }; /** * List all authenticated domains * **This endpoint allows you to retrieve a list of all domains you have authenticated.** */ export const getWhitelabelDomains = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/whitelabel/domains', }); }; /** * Authenticate a domain * **This endpoint allows you to authenticate a domain.** * * If you are authenticating a domain for a subuser, you have two options: * 1. Use the "username" parameter. This allows you to authenticate a domain on behalf of your subuser. This means the subuser is able to see and modify the authenticated domain. * 2. Use the Association workflow (see Associate Domain section). This allows you to authenticate a domain created by the parent to a subuser. This means the subuser will default to the assigned domain, but will not be able to see or modify that authenticated domain. However, if the subuser authenticates their own domain it will overwrite the assigned domain. */ export const postWhitelabelDomains = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/whitelabel/domains', }); }; /** * Get the default authentication * **This endpoint allows you to retrieve the default authentication for a domain.** * * When creating or updating a domain authentication, you can set the domain as a default. The default domain will be used to send all mail. If you have multiple authenticated domains, the authenticated domain matching the domain of the From address will be used, and the default will be overridden. * * This endpoint will return a default domain and its details only if a default is set. You are not required to set a default. If you do not set a default domain, this endpoint will return general information about your domain authentication status. */ export const getWhitelabelDomainsDefault = ( options?: Options, ) => { return (options?.client ?? client).get< GetWhitelabelDomainsDefaultResponse, GetWhitelabelDomainsDefaultError, ThrowOnError >({ ...options, url: '/whitelabel/domains/default', }); }; /** * Disassociate an authenticated domain from a given user. * **This endpoint allows you to disassociate a specific authenticated domain from a subuser.** * * Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. */ export const deleteWhitelabelDomainsSubuser = ( options?: Options, ) => { return (options?.client ?? client).delete< DeleteWhitelabelDomainsSubuserResponse, DeleteWhitelabelDomainsSubuserError, ThrowOnError >({ ...options, url: '/whitelabel/domains/subuser', }); }; /** * List the authenticated domain associated with the given user. * **This endpoint allows you to retrieve all of the authenticated domains that have been assigned to a specific subuser.** * * Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. */ export const getWhitelabelDomainsSubuser = ( options: Options, ) => { return (options?.client ?? client).get< GetWhitelabelDomainsSubuserResponse, GetWhitelabelDomainsSubuserError, ThrowOnError >({ ...options, url: '/whitelabel/domains/subuser', }); }; /** * Delete an authenticated domain. * **This endpoint allows you to delete an authenticated domain.** */ export const deleteWhitelabelDomainsDomainId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteWhitelabelDomainsDomainIdResponse, DeleteWhitelabelDomainsDomainIdError, ThrowOnError >({ ...options, url: '/whitelabel/domains/{domain_id}', }); }; /** * Retrieve an authenticated domain * **This endpoint allows you to retrieve a specific authenticated domain.** */ export const getWhitelabelDomainsDomainId = ( options: Options, ) => { return (options?.client ?? client).get< GetWhitelabelDomainsDomainIdResponse, GetWhitelabelDomainsDomainIdError, ThrowOnError >({ ...options, url: '/whitelabel/domains/{domain_id}', }); }; /** * Update an authenticated domain * **This endpoint allows you to update the settings for an authenticated domain.** */ export const patchWhitelabelDomainsDomainId = ( options: Options, ) => { return (options?.client ?? client).patch< PatchWhitelabelDomainsDomainIdResponse, PatchWhitelabelDomainsDomainIdError, ThrowOnError >({ ...options, url: '/whitelabel/domains/{domain_id}', }); }; /** * Associate an authenticated domain with a given user. * **This endpoint allows you to associate a specific authenticated domain with a subuser.** * * Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. */ export const postWhitelabelDomainsDomainIdSubuser = ( options: Options, ) => { return (options?.client ?? client).post< PostWhitelabelDomainsDomainIdSubuserResponse, PostWhitelabelDomainsDomainIdSubuserError, ThrowOnError >({ ...options, url: '/whitelabel/domains/{domain_id}/subuser', }); }; /** * Add an IP to an authenticated domain * **This endpoint allows you to add an IP address to an authenticated domain.** */ export const postWhitelabelDomainsIdIps = ( options: Options, ) => { return (options?.client ?? client).post< PostWhitelabelDomainsIdIpsResponse, PostWhitelabelDomainsIdIpsError, ThrowOnError >({ ...options, url: '/whitelabel/domains/{id}/ips', }); }; /** * Remove an IP from an authenticated domain. * **This endpoint allows you to remove an IP address from that domain's authentication.** */ export const deleteWhitelabelDomainsIdIpsIp = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteWhitelabelDomainsIdIpsIpResponse, DeleteWhitelabelDomainsIdIpsIpError, ThrowOnError >({ ...options, url: '/whitelabel/domains/{id}/ips/{ip}', }); }; /** * Validate a domain authentication. * **This endpoint allows you to validate an authenticated domain. If it fails, it will return an error message describing why the domain could not be validated.** */ export const postWhitelabelDomainsIdValidate = ( options: Options, ) => { return (options?.client ?? client).post< PostWhitelabelDomainsIdValidateResponse, PostWhitelabelDomainsIdValidateError, ThrowOnError >({ ...options, url: '/whitelabel/domains/{id}/validate', }); }; /** * Retrieve all reverse DNS records * **This endpoint allows you to retrieve all of the Reverse DNS records created by this account.** * * You may include a search key by using the `ip` query string parameter. This enables you to perform a prefix search for a given IP segment (e.g., `?ip="192."`). * * Use the `limit` query string parameter to reduce the number of records returned. All records will be returned if you have fewer records than the specified limit. * * The `offset` query string parameter allows you to specify a non-zero index from which records will be returned. For example, if you have ten records, `?offset=5` will return the last five records (at indexes 5 through 9). The list starts at index zero. */ export const getWhitelabelIps = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/whitelabel/ips', }); }; /** * Set up reverse DNS * **This endpoint allows you to set up reverse DNS.** */ export const postWhitelabelIps = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/whitelabel/ips', }); }; /** * Delete a reverse DNS record * **This endpoint allows you to delete a reverse DNS record.** * * A call to this endpoint will respond with a 204 status code if the deletion was successful. * * You can retrieve the IDs associated with all your reverse DNS records using the "Retrieve all reverse DNS records" endpoint. */ export const deleteWhitelabelIpsId = ( options: Options, ) => { return (options?.client ?? client).delete({ ...options, url: '/whitelabel/ips/{id}', }); }; /** * Retrieve a reverse DNS record * **This endpoint allows you to retrieve a reverse DNS record.** * * You can retrieve the IDs associated with all your reverse DNS records using the "Retrieve all reverse DNS records" endpoint. */ export const getWhitelabelIpsId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/whitelabel/ips/{id}', }); }; /** * Validate a reverse DNS record * **This endpoint allows you to validate a reverse DNS record.** * * Always check the `valid` property of the response’s `validation_results.a_record` object. This field will indicate whether it was possible to validate the reverse DNS record. If the `validation_results.a_record.valid` is `false`, this indicates only that Twilio SendGrid could not determine the validity your reverse DNS record — it may still be valid. * * If validity couldn’t be determined, you can check the value of `validation_results.a_record.reason` to find out why. * * You can retrieve the IDs associated with all your reverse DNS records using the "Retrieve all reverse DNS records" endpoint. */ export const postWhitelabelIpsIdValidate = ( options: Options, ) => { return (options?.client ?? client).post< PostWhitelabelIpsIdValidateResponse, PostWhitelabelIpsIdValidateError, ThrowOnError >({ ...options, url: '/whitelabel/ips/{id}/validate', }); }; /** * Retrieve all branded links * **This endpoint allows you to retrieve all branded links**. * * You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. */ export const getWhitelabelLinks = ( options?: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/whitelabel/links', }); }; /** * Create a branded link * **This endpoint allows you to create a new branded link.** * * To create the link branding, supply the root domain and, optionally, the subdomain — these go into separate fields in your request body. The root domain should match your FROM email address. If you provide a subdomain, it must be different from the subdomain you used for authenticating your domain. * * You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. */ export const postWhitelabelLinks = ( options?: Options, ) => { return (options?.client ?? client).post({ ...options, url: '/whitelabel/links', }); }; /** * Retrieve the default branded link * **This endpoint allows you to retrieve the default branded link.** * * The default branded link is the actual URL to be used when sending messages. If you have more than one branded link, the default is determined by the following order: * * * The validated branded link marked as `default` (set when you call the "Create a branded link" endpoint or by calling the "Update a branded link" endpoint on an existing link) * * Legacy branded links (migrated from the whitelabel wizard) * * Default SendGrid-branded links (i.e., `100.ct.sendgrid.net`) * * You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. */ export const getWhitelabelLinksDefault = ( options?: Options, ) => { return (options?.client ?? client).get< GetWhitelabelLinksDefaultResponse, GetWhitelabelLinksDefaultError, ThrowOnError >({ ...options, url: '/whitelabel/links/default', }); }; /** * Disassociate a branded link from a subuser * **This endpoint allows you to take a branded link away from a subuser.** * * Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). * * Your request will receive a response with a 204 status code if the disassociation was successful. */ export const deleteWhitelabelLinksSubuser = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteWhitelabelLinksSubuserResponse, DeleteWhitelabelLinksSubuserError, ThrowOnError >({ ...options, url: '/whitelabel/links/subuser', }); }; /** * Retrieve a subuser's branded link * **This endpoint allows you to retrieve the branded link associated with a subuser.** * * Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and then validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). */ export const getWhitelabelLinksSubuser = ( options: Options, ) => { return (options?.client ?? client).get< GetWhitelabelLinksSubuserResponse, GetWhitelabelLinksSubuserError, ThrowOnError >({ ...options, url: '/whitelabel/links/subuser', }); }; /** * Delete a branded link * **This endpoint allows you to delete a branded link.** * * Your request will receive a response with a 204 status code if the deletion was successful. The call does not return the link's details, so if you wish to record these make sure you call the "Retrieve a branded link" endpoint *before* you request its deletion. * * You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. */ export const deleteWhitelabelLinksId = ( options: Options, ) => { return (options?.client ?? client).delete< DeleteWhitelabelLinksIdResponse, DeleteWhitelabelLinksIdError, ThrowOnError >({ ...options, url: '/whitelabel/links/{id}', }); }; /** * Retrieve a branded link * **This endpoint allows you to retrieve a specific branded link by providing its ID.** * * You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. */ export const getWhitelabelLinksId = ( options: Options, ) => { return (options?.client ?? client).get({ ...options, url: '/whitelabel/links/{id}', }); }; /** * Update a branded link * **This endpoint allows you to update a specific branded link. You can use this endpoint to change a branded link's default status.** * * You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. */ export const patchWhitelabelLinksId = ( options: Options, ) => { return (options?.client ?? client).patch({ ...options, url: '/whitelabel/links/{id}', }); }; /** * Validate a branded link * **This endpoint allows you to validate a branded link.** * * You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. */ export const postWhitelabelLinksIdValidate = ( options: Options, ) => { return (options?.client ?? client).post< PostWhitelabelLinksIdValidateResponse, PostWhitelabelLinksIdValidateError, ThrowOnError >({ ...options, url: '/whitelabel/links/{id}/validate', }); }; /** * Associate a branded link with a subuser * **This endpoint allows you to associate a branded link with a subuser account.** * * Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). */ export const postWhitelabelLinksLinkIdSubuser = ( options: Options, ) => { return (options?.client ?? client).post< PostWhitelabelLinksLinkIdSubuserResponse, PostWhitelabelLinksLinkIdSubuserError, ThrowOnError >({ ...options, url: '/whitelabel/links/{link_id}/subuser', }); };