svix

package
v1.64.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 12 Imported by: 14

README

Svix - Webhooks as a service

Website | Documentation | Community Slack

Go library for interacting with the Svix API and verifying webhook signatures

GitHub tag PkgGoDev

Join our slack

Usage Documentation

You can find general usage documentation at https://docs.svix.com. For complete API documentation with code examples for each endpoint in all of our official client libraries head over to our API documentation site at https://api.svix.com.

Language Support

⚡️ Features ⚡️
Officially Supported
API Support
Signature Verification
Caveats None! 🚀

Development

First checkout the core README for details on how to generate our API bindings, then follow the steps below.

Requirements

  • go >= 1.16

Contributing

Before opening a PR be sure to format your code!

go fmt ./...

Running Tests

Simply run:

go test ./...

Publishing

Releases use go modules and are automatically published by tagging the release commit.

Documentation

Overview

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Package svix this file is @generated DO NOT EDIT

Index

Constants

View Source
const Version = "1.64.1"

Variables

This section is empty.

Functions

func NewMessageInRaw added in v1.43.0

func NewMessageInRaw(
	eventType string,
	payload string,
	contentType *string,
) *models.MessageIn

Instantiates a new MessageIn object with a raw string payload. The payload is not normalized on the server. Normally, payloads are required to be JSON, and Svix will minify the payload before sending the webhook (for example, by removing extraneous whitespace or unnecessarily escaped characters in strings). With this function, the payload will be sent "as is", without any minification or other processing.

The `contentType` parameter can be used to change the `content-type` header of the webhook sent by Svix overriding the default of `application/json`.

See the class documentation for details about the other parameters.

Types

type AdobeSignConfig added in v1.63.0

type AdobeSignConfig = models.AdobeSignConfig

type AdobeSignConfigOut added in v1.63.0

type AdobeSignConfigOut = models.AdobeSignConfigOut

type AggregateEventTypesOut added in v1.14.0

type AggregateEventTypesOut = models.AggregateEventTypesOut

type ApiTokenCensoredOut added in v1.63.1

type ApiTokenCensoredOut = models.ApiTokenCensoredOut

type ApiTokenExpireIn added in v1.63.1

type ApiTokenExpireIn = models.ApiTokenExpireIn

type ApiTokenIn added in v1.63.1

type ApiTokenIn = models.ApiTokenIn

type ApiTokenOut added in v1.63.1

type ApiTokenOut = models.ApiTokenOut

type AppPortalAccessIn added in v0.75.0

type AppPortalAccessIn = models.AppPortalAccessIn

type AppPortalAccessOut added in v0.75.0

type AppPortalAccessOut = models.AppPortalAccessOut

type AppUsageStatsIn added in v1.14.0

type AppUsageStatsIn = models.AppUsageStatsIn

type AppUsageStatsOut added in v1.14.0

type AppUsageStatsOut = models.AppUsageStatsOut

type Application

type Application struct {
	// contains filtered or unexported fields
}

func (*Application) Create

func (application *Application) Create(
	ctx context.Context,
	applicationIn models.ApplicationIn,
	o *ApplicationCreateOptions,
) (*models.ApplicationOut, error)

Create a new application.

func (*Application) Delete

func (application *Application) Delete(
	ctx context.Context,
	appId string,
) error

Delete an application.

func (*Application) Get

func (application *Application) Get(
	ctx context.Context,
	appId string,
) (*models.ApplicationOut, error)

Get an application.

func (*Application) GetOrCreate added in v0.52.0

func (application *Application) GetOrCreate(
	ctx context.Context,
	applicationIn models.ApplicationIn,
	o *ApplicationCreateOptions,
) (*models.ApplicationOut, error)

Get or create a new application.

func (*Application) List

List of all the organization's applications.

func (*Application) Patch added in v1.6.0

func (application *Application) Patch(
	ctx context.Context,
	appId string,
	applicationPatch models.ApplicationPatch,
) (*models.ApplicationOut, error)

Partially update an application.

func (*Application) Update

func (application *Application) Update(
	ctx context.Context,
	appId string,
	applicationIn models.ApplicationIn,
) (*models.ApplicationOut, error)

Update an application.

type ApplicationCreateOptions added in v1.57.0

type ApplicationCreateOptions struct {
	IdempotencyKey *string
}

type ApplicationIn

type ApplicationIn = models.ApplicationIn

type ApplicationListOptions

type ApplicationListOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
}

type ApplicationOut

type ApplicationOut = models.ApplicationOut

type ApplicationPatch added in v1.6.0

type ApplicationPatch = models.ApplicationPatch

type ApplicationTokenExpireIn added in v1.58.2

type ApplicationTokenExpireIn = models.ApplicationTokenExpireIn

type Authentication

type Authentication struct {
	// contains filtered or unexported fields
}

func (*Authentication) AppPortalAccess added in v0.75.0

func (authentication *Authentication) AppPortalAccess(
	ctx context.Context,
	appId string,
	appPortalAccessIn models.AppPortalAccessIn,
	o *AuthenticationAppPortalAccessOptions,
) (*models.AppPortalAccessOut, error)

Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.

func (*Authentication) DashboardAccess deprecated

func (authentication *Authentication) DashboardAccess(
	ctx context.Context,
	appId string,
	o *AuthenticationDashboardAccessOptions,
) (*models.DashboardAccessOut, error)

Deprecated: Please use `AppPortalAccess` instead.

func (*Authentication) ExpireAll added in v1.57.0

func (authentication *Authentication) ExpireAll(
	ctx context.Context,
	appId string,
	applicationTokenExpireIn models.ApplicationTokenExpireIn,
	o *AuthenticationExpireAllOptions,
) error

Expire all of the tokens associated with a specific application.

func (*Authentication) Logout

func (authentication *Authentication) Logout(
	ctx context.Context,
	o *AuthenticationLogoutOptions,
) error

Logout an app token.

Trying to log out other tokens will fail.

type AuthenticationAppPortalAccessOptions added in v1.57.0

type AuthenticationAppPortalAccessOptions struct {
	IdempotencyKey *string
}

type AuthenticationDashboardAccessOptions added in v1.57.0

type AuthenticationDashboardAccessOptions struct {
	IdempotencyKey *string
}

type AuthenticationExpireAllOptions added in v1.57.0

type AuthenticationExpireAllOptions struct {
	IdempotencyKey *string
}

type AuthenticationLogoutOptions added in v1.57.0

type AuthenticationLogoutOptions struct {
	IdempotencyKey *string
}

type BackgroundTask added in v1.4.12

type BackgroundTask struct {
	// contains filtered or unexported fields
}

func (*BackgroundTask) Get added in v1.4.12

func (backgroundTask *BackgroundTask) Get(
	ctx context.Context,
	taskId string,
) (*models.BackgroundTaskOut, error)

Get a background task by ID.

func (*BackgroundTask) List added in v1.4.12

List background tasks executed in the past 90 days.

type BackgroundTaskFinishedEvent added in v1.63.0

type BackgroundTaskFinishedEvent = models.BackgroundTaskFinishedEvent

type BackgroundTaskFinishedEvent2 added in v1.63.0

type BackgroundTaskFinishedEvent2 = models.BackgroundTaskFinishedEvent2

type BackgroundTaskListOptions added in v1.4.12

type BackgroundTaskListOptions struct {

	// Filter the response based on the status.
	Status *models.BackgroundTaskStatus

	// Filter the response based on the type.
	Task *models.BackgroundTaskType
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
}

type BackgroundTaskOut added in v1.4.12

type BackgroundTaskOut = models.BackgroundTaskOut

type BackgroundTaskStatus added in v1.58.2

type BackgroundTaskStatus = models.BackgroundTaskStatus

type BackgroundTaskType added in v1.58.2

type BackgroundTaskType = models.BackgroundTaskType

type ConnectorIn added in v1.58.2

type ConnectorIn = models.ConnectorIn

type ConnectorKind added in v1.58.2

type ConnectorKind = models.ConnectorKind

type ConnectorOut added in v1.63.0

type ConnectorOut = models.ConnectorOut

type CronConfig added in v1.63.0

type CronConfig = models.CronConfig

type DashboardAccessOut

type DashboardAccessOut = models.DashboardAccessOut

type DocusignConfig added in v1.63.0

type DocusignConfig = models.DocusignConfig

type DocusignConfigOut added in v1.63.0

type DocusignConfigOut = models.DocusignConfigOut

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

func (*Endpoint) Create

func (endpoint *Endpoint) Create(
	ctx context.Context,
	appId string,
	endpointIn models.EndpointIn,
	o *EndpointCreateOptions,
) (*models.EndpointOut, error)

Create a new endpoint for the application.

When `secret` is `null` the secret is automatically generated (recommended).

func (*Endpoint) Delete

func (endpoint *Endpoint) Delete(
	ctx context.Context,
	appId string,
	endpointId string,
) error

Delete an endpoint.

func (*Endpoint) Get

func (endpoint *Endpoint) Get(
	ctx context.Context,
	appId string,
	endpointId string,
) (*models.EndpointOut, error)

Get an endpoint.

func (*Endpoint) GetHeaders

func (endpoint *Endpoint) GetHeaders(
	ctx context.Context,
	appId string,
	endpointId string,
) (*models.EndpointHeadersOut, error)

Get the additional headers to be sent with the webhook.

func (*Endpoint) GetSecret

func (endpoint *Endpoint) GetSecret(
	ctx context.Context,
	appId string,
	endpointId string,
) (*models.EndpointSecretOut, error)

Get the endpoint's signing secret.

This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).

func (*Endpoint) GetStats added in v0.66.0

func (endpoint *Endpoint) GetStats(
	ctx context.Context,
	appId string,
	endpointId string,
	o *EndpointGetStatsOptions,
) (*models.EndpointStats, error)

Get basic statistics for the endpoint.

func (*Endpoint) List

func (endpoint *Endpoint) List(
	ctx context.Context,
	appId string,
	o *EndpointListOptions,
) (*models.ListResponseEndpointOut, error)

List the application's endpoints.

func (*Endpoint) Patch added in v1.6.0

func (endpoint *Endpoint) Patch(
	ctx context.Context,
	appId string,
	endpointId string,
	endpointPatch models.EndpointPatch,
) (*models.EndpointOut, error)

Partially update an endpoint.

func (*Endpoint) PatchHeaders

func (endpoint *Endpoint) PatchHeaders(
	ctx context.Context,
	appId string,
	endpointId string,
	endpointHeadersPatchIn models.EndpointHeadersPatchIn,
) error

Partially set the additional headers to be sent with the webhook.

func (*Endpoint) Recover

func (endpoint *Endpoint) Recover(
	ctx context.Context,
	appId string,
	endpointId string,
	recoverIn models.RecoverIn,
	o *EndpointRecoverOptions,
) (*models.RecoverOut, error)

Resend all failed messages since a given time.

Messages that were sent successfully, even if failed initially, are not resent.

func (*Endpoint) ReplayMissing added in v0.76.1

func (endpoint *Endpoint) ReplayMissing(
	ctx context.Context,
	appId string,
	endpointId string,
	replayIn models.ReplayIn,
	o *EndpointReplayMissingOptions,
) (*models.ReplayOut, error)

Replays messages to the endpoint.

Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent.

func (*Endpoint) RotateSecret

func (endpoint *Endpoint) RotateSecret(
	ctx context.Context,
	appId string,
	endpointId string,
	endpointSecretRotateIn models.EndpointSecretRotateIn,
	o *EndpointRotateSecretOptions,
) error

Rotates the endpoint's signing secret.

The previous secret will remain valid for the next 24 hours.

func (*Endpoint) SendExample added in v0.83.0

func (endpoint *Endpoint) SendExample(
	ctx context.Context,
	appId string,
	endpointId string,
	eventExampleIn models.EventExampleIn,
	o *EndpointSendExampleOptions,
) (*models.MessageOut, error)

Send an example message for an event.

func (*Endpoint) TransformationGet added in v0.76.0

func (endpoint *Endpoint) TransformationGet(
	ctx context.Context,
	appId string,
	endpointId string,
) (*models.EndpointTransformationOut, error)

Get the transformation code associated with this endpoint.

func (*Endpoint) TransformationPartialUpdate added in v1.14.0

func (endpoint *Endpoint) TransformationPartialUpdate(
	ctx context.Context,
	appId string,
	endpointId string,
	endpointTransformationIn models.EndpointTransformationIn,
) error

Set or unset the transformation code associated with this endpoint.

func (*Endpoint) Update

func (endpoint *Endpoint) Update(
	ctx context.Context,
	appId string,
	endpointId string,
	endpointUpdate models.EndpointUpdate,
) (*models.EndpointOut, error)

Update an endpoint.

func (*Endpoint) UpdateHeaders

func (endpoint *Endpoint) UpdateHeaders(
	ctx context.Context,
	appId string,
	endpointId string,
	endpointHeadersIn models.EndpointHeadersIn,
) error

Set the additional headers to be sent with the webhook.

type EndpointCreateOptions added in v1.57.0

type EndpointCreateOptions struct {
	IdempotencyKey *string
}

type EndpointCreatedEvent added in v1.63.0

type EndpointCreatedEvent = models.EndpointCreatedEvent

type EndpointCreatedEventData added in v1.63.0

type EndpointCreatedEventData = models.EndpointCreatedEventData

type EndpointDeletedEvent added in v1.63.0

type EndpointDeletedEvent = models.EndpointDeletedEvent

type EndpointDeletedEventData added in v1.63.0

type EndpointDeletedEventData = models.EndpointDeletedEventData

type EndpointDisabledEvent added in v1.63.0

type EndpointDisabledEvent = models.EndpointDisabledEvent

type EndpointDisabledEventData added in v1.63.0

type EndpointDisabledEventData = models.EndpointDisabledEventData

type EndpointDisabledTrigger added in v1.63.0

type EndpointDisabledTrigger = models.EndpointDisabledTrigger

type EndpointEnabledEvent added in v1.63.0

type EndpointEnabledEvent = models.EndpointEnabledEvent

type EndpointEnabledEventData added in v1.63.0

type EndpointEnabledEventData = models.EndpointEnabledEventData

type EndpointGetStatsOptions added in v1.57.0

type EndpointGetStatsOptions struct {
	// Filter the range to data starting from this date.
	Since *time.Time
	// Filter the range to data ending by this date.
	Until *time.Time
}

type EndpointHeadersIn

type EndpointHeadersIn = models.EndpointHeadersIn

type EndpointHeadersOut

type EndpointHeadersOut = models.EndpointHeadersOut

type EndpointHeadersPatchIn added in v0.57.1

type EndpointHeadersPatchIn = models.EndpointHeadersPatchIn

type EndpointIn

type EndpointIn = models.EndpointIn

type EndpointListOptions

type EndpointListOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
}

type EndpointMessageOut added in v0.83.0

type EndpointMessageOut = models.EndpointMessageOut

type EndpointOut

type EndpointOut = models.EndpointOut

type EndpointPatch added in v1.6.0

type EndpointPatch = models.EndpointPatch

type EndpointRecoverOptions added in v1.57.0

type EndpointRecoverOptions struct {
	IdempotencyKey *string
}

type EndpointReplayMissingOptions added in v1.57.0

type EndpointReplayMissingOptions struct {
	IdempotencyKey *string
}

type EndpointRotateSecretOptions added in v1.57.0

type EndpointRotateSecretOptions struct {
	IdempotencyKey *string
}

type EndpointSecretOut

type EndpointSecretOut = models.EndpointSecretOut

type EndpointSecretRotateIn

type EndpointSecretRotateIn = models.EndpointSecretRotateIn

type EndpointSendExampleOptions added in v1.57.0

type EndpointSendExampleOptions struct {
	IdempotencyKey *string
}

type EndpointStats added in v0.66.0

type EndpointStats = models.EndpointStats

type EndpointTransformationIn added in v0.76.0

type EndpointTransformationIn = models.EndpointTransformationIn

type EndpointTransformationOut added in v0.76.0

type EndpointTransformationOut = models.EndpointTransformationOut

type EndpointUpdate

type EndpointUpdate = models.EndpointUpdate

type EndpointUpdatedEvent added in v1.63.0

type EndpointUpdatedEvent = models.EndpointUpdatedEvent

type EndpointUpdatedEventData added in v1.63.0

type EndpointUpdatedEventData = models.EndpointUpdatedEventData

type Environment added in v1.63.0

type Environment struct {
	// contains filtered or unexported fields
}

func (*Environment) Export added in v1.63.0

func (environment *Environment) Export(
	ctx context.Context,
	o *EnvironmentExportOptions,
) (*models.EnvironmentOut, error)

Download a JSON file containing all org-settings and event types.

func (*Environment) Import added in v1.63.0

func (environment *Environment) Import(
	ctx context.Context,
	environmentIn models.EnvironmentIn,
	o *EnvironmentImportOptions,
) error

Import a configuration into the active organization.

It doesn't delete anything, only adds / updates what was passed to it.

type EnvironmentExportOptions added in v1.63.0

type EnvironmentExportOptions struct {
	IdempotencyKey *string
}

type EnvironmentImportOptions added in v1.63.0

type EnvironmentImportOptions struct {
	IdempotencyKey *string
}

type EnvironmentIn added in v1.58.2

type EnvironmentIn = models.EnvironmentIn

type EnvironmentOut added in v1.58.2

type EnvironmentOut = models.EnvironmentOut

type Error

type Error = internal.Error

type EventExampleIn added in v0.83.0

type EventExampleIn = models.EventExampleIn

type EventType

type EventType struct {
	// contains filtered or unexported fields
}

func (*EventType) Create

func (eventType *EventType) Create(
	ctx context.Context,
	eventTypeIn models.EventTypeIn,
	o *EventTypeCreateOptions,
) (*models.EventTypeOut, error)

Create new or unarchive existing event type.

Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. Endpoints filtering on the event type before archival will continue to filter on it. This operation does not preserve the description and schemas.

func (*EventType) Delete

func (eventType *EventType) Delete(
	ctx context.Context,
	eventTypeName string,
	o *EventTypeDeleteOptions,
) error

Archive an event type.

Endpoints already configured to filter on an event type will continue to do so after archival. However, new messages can not be sent with it and endpoints can not filter on it. An event type can be unarchived with the [create operation](#operation/create_event_type_api_v1_event_type__post).

func (*EventType) Get

func (eventType *EventType) Get(
	ctx context.Context,
	eventTypeName string,
) (*models.EventTypeOut, error)

Get an event type.

func (*EventType) ImportOpenapi added in v1.57.0

func (eventType *EventType) ImportOpenapi(
	ctx context.Context,
	eventTypeImportOpenApiIn models.EventTypeImportOpenApiIn,
	o *EventTypeImportOpenapiOptions,
) (*models.EventTypeImportOpenApiOut, error)

Given an OpenAPI spec, create new or update existing event types. If an existing `archived` event type is updated, it will be unarchived.

The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks` top-level.

func (*EventType) List

Return the list of event types.

func (*EventType) Patch added in v1.6.0

func (eventType *EventType) Patch(
	ctx context.Context,
	eventTypeName string,
	eventTypePatch models.EventTypePatch,
) (*models.EventTypeOut, error)

Partially update an event type.

func (*EventType) Update

func (eventType *EventType) Update(
	ctx context.Context,
	eventTypeName string,
	eventTypeUpdate models.EventTypeUpdate,
) (*models.EventTypeOut, error)

Update an event type.

type EventTypeCreateOptions added in v1.57.0

type EventTypeCreateOptions struct {
	IdempotencyKey *string
}

type EventTypeDeleteOptions added in v1.13.0

type EventTypeDeleteOptions struct {
	// By default event types are archived when "deleted". Passing this to `true` deletes them entirely.
	Expunge *bool
}

type EventTypeFromOpenApi added in v1.58.2

type EventTypeFromOpenApi = models.EventTypeFromOpenApi

type EventTypeImportOpenApiIn added in v1.11.0

type EventTypeImportOpenApiIn = models.EventTypeImportOpenApiIn

type EventTypeImportOpenApiOut added in v1.11.0

type EventTypeImportOpenApiOut = models.EventTypeImportOpenApiOut

type EventTypeImportOpenApiOutData added in v1.11.0

type EventTypeImportOpenApiOutData = models.EventTypeImportOpenApiOutData

type EventTypeImportOpenapiOptions added in v1.57.0

type EventTypeImportOpenapiOptions struct {
	IdempotencyKey *string
}

type EventTypeIn

type EventTypeIn = models.EventTypeIn

type EventTypeListOptions

type EventTypeListOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
	// When `true` archived (deleted but not expunged) items are included in the response.
	IncludeArchived *bool
	// When `true` the full item (including the schema) is included in the response.
	WithContent *bool
}

type EventTypeOut

type EventTypeOut = models.EventTypeOut

type EventTypePatch added in v1.6.0

type EventTypePatch = models.EventTypePatch

type EventTypeUpdate

type EventTypeUpdate = models.EventTypeUpdate

type ExpungeAllContentsOut added in v1.61.1

type ExpungeAllContentsOut = models.ExpungeAllContentsOut

type GithubConfig added in v1.63.0

type GithubConfig = models.GithubConfig

type GithubConfigOut added in v1.63.0

type GithubConfigOut = models.GithubConfigOut

type HubspotConfig added in v1.63.0

type HubspotConfig = models.HubspotConfig

type HubspotConfigOut added in v1.63.0

type HubspotConfigOut = models.HubspotConfigOut

type Ingest added in v1.63.0

type Ingest struct {
	Endpoint *IngestEndpoint
	Source   *IngestSource
	// contains filtered or unexported fields
}

func (*Ingest) Dashboard added in v1.63.0

func (ingest *Ingest) Dashboard(
	ctx context.Context,
	sourceId string,
	ingestSourceConsumerPortalAccessIn models.IngestSourceConsumerPortalAccessIn,
	o *IngestDashboardOptions,
) (*models.DashboardAccessOut, error)

Get access to the Ingest Source Consumer Portal.

type IngestDashboardOptions added in v1.63.0

type IngestDashboardOptions struct {
	IdempotencyKey *string
}

type IngestEndpoint added in v1.63.0

type IngestEndpoint struct {
	// contains filtered or unexported fields
}

func (*IngestEndpoint) Create added in v1.63.0

func (ingestEndpoint *IngestEndpoint) Create(
	ctx context.Context,
	ingestEndpointIn models.IngestEndpointIn,
	o *IngestEndpointCreateOptions,
) (*models.IngestEndpointOut, error)

Create an ingest endpoint.

func (*IngestEndpoint) Delete added in v1.63.0

func (ingestEndpoint *IngestEndpoint) Delete(
	ctx context.Context,
	endpointId string,
) error

Delete an ingest endpoint.

func (*IngestEndpoint) Get added in v1.63.0

func (ingestEndpoint *IngestEndpoint) Get(
	ctx context.Context,
	endpointId string,
) (*models.IngestEndpointOut, error)

Get an ingest endpoint.

func (*IngestEndpoint) GetHeaders added in v1.63.0

func (ingestEndpoint *IngestEndpoint) GetHeaders(
	ctx context.Context,
	endpointId string,
) (*models.IngestEndpointHeadersOut, error)

Get the additional headers to be sent with the ingest.

func (*IngestEndpoint) GetSecret added in v1.63.0

func (ingestEndpoint *IngestEndpoint) GetSecret(
	ctx context.Context,
	endpointId string,
) (*models.IngestEndpointSecretOut, error)

Get an ingest endpoint's signing secret.

This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).

func (*IngestEndpoint) List added in v1.63.0

List ingest endpoints.

func (*IngestEndpoint) RotateSecret added in v1.63.0

func (ingestEndpoint *IngestEndpoint) RotateSecret(
	ctx context.Context,
	endpointId string,
	ingestEndpointSecretIn models.IngestEndpointSecretIn,
	o *IngestEndpointRotateSecretOptions,
) error

Rotates an ingest endpoint's signing secret.

The previous secret will remain valid for the next 24 hours.

func (*IngestEndpoint) Update added in v1.63.0

func (ingestEndpoint *IngestEndpoint) Update(
	ctx context.Context,
	endpointId string,
	ingestEndpointUpdate models.IngestEndpointUpdate,
) (*models.IngestEndpointOut, error)

Update an ingest endpoint.

func (*IngestEndpoint) UpdateHeaders added in v1.63.0

func (ingestEndpoint *IngestEndpoint) UpdateHeaders(
	ctx context.Context,
	endpointId string,
	ingestEndpointHeadersIn models.IngestEndpointHeadersIn,
) error

Set the additional headers to be sent to the endpoint.

type IngestEndpointCreateOptions added in v1.63.0

type IngestEndpointCreateOptions struct {
	IdempotencyKey *string
}

type IngestEndpointHeadersIn added in v1.61.1

type IngestEndpointHeadersIn = models.IngestEndpointHeadersIn

type IngestEndpointHeadersOut added in v1.61.1

type IngestEndpointHeadersOut = models.IngestEndpointHeadersOut

type IngestEndpointIn added in v1.61.1

type IngestEndpointIn = models.IngestEndpointIn

type IngestEndpointListOptions added in v1.63.0

type IngestEndpointListOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
}

type IngestEndpointOut added in v1.61.1

type IngestEndpointOut = models.IngestEndpointOut

type IngestEndpointRotateSecretOptions added in v1.63.0

type IngestEndpointRotateSecretOptions struct {
	IdempotencyKey *string
}

type IngestEndpointSecretIn added in v1.61.1

type IngestEndpointSecretIn = models.IngestEndpointSecretIn

type IngestEndpointSecretOut added in v1.61.1

type IngestEndpointSecretOut = models.IngestEndpointSecretOut

type IngestEndpointUpdate added in v1.61.1

type IngestEndpointUpdate = models.IngestEndpointUpdate

type IngestSource added in v1.63.0

type IngestSource struct {
	// contains filtered or unexported fields
}

func (*IngestSource) Create added in v1.63.0

func (ingestSource *IngestSource) Create(
	ctx context.Context,
	ingestSourceIn models.IngestSourceIn,
	o *IngestSourceCreateOptions,
) (*models.IngestSourceOut, error)

Create Ingest Source.

func (*IngestSource) Delete added in v1.63.0

func (ingestSource *IngestSource) Delete(
	ctx context.Context,
	sourceId string,
) error

Delete an Ingest Source.

func (*IngestSource) Get added in v1.63.0

func (ingestSource *IngestSource) Get(
	ctx context.Context,
	sourceId string,
) (*models.IngestSourceOut, error)

Get an Ingest Source by id or uid.

func (*IngestSource) List added in v1.63.0

List of all the organization's Ingest Sources.

func (*IngestSource) RotateToken added in v1.63.0

func (ingestSource *IngestSource) RotateToken(
	ctx context.Context,
	sourceId string,
	o *IngestSourceRotateTokenOptions,
) (*models.RotateTokenOut, error)

Rotate the Ingest Source's Url Token.

This will rotate the ingest source's token, which is used to construct the unique `ingestUrl` for the source. Previous tokens will remain valid for 48 hours after rotation. The token can be rotated a maximum of three times within the 48-hour period.

func (*IngestSource) Update added in v1.63.0

func (ingestSource *IngestSource) Update(
	ctx context.Context,
	sourceId string,
	ingestSourceIn models.IngestSourceIn,
) (*models.IngestSourceOut, error)

Update an Ingest Source.

type IngestSourceConsumerPortalAccessIn added in v1.63.0

type IngestSourceConsumerPortalAccessIn = models.IngestSourceConsumerPortalAccessIn

type IngestSourceCreateOptions added in v1.63.0

type IngestSourceCreateOptions struct {
	IdempotencyKey *string
}

type IngestSourceIn added in v1.63.0

type IngestSourceIn = models.IngestSourceIn

type IngestSourceListOptions added in v1.63.0

type IngestSourceListOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
}

type IngestSourceOut added in v1.63.0

type IngestSourceOut = models.IngestSourceOut

type IngestSourceRotateTokenOptions added in v1.63.0

type IngestSourceRotateTokenOptions struct {
	IdempotencyKey *string
}

type Integration

type Integration struct {
	// contains filtered or unexported fields
}

func (*Integration) Create

func (integration *Integration) Create(
	ctx context.Context,
	appId string,
	integrationIn models.IntegrationIn,
	o *IntegrationCreateOptions,
) (*models.IntegrationOut, error)

Create an integration.

func (*Integration) Delete

func (integration *Integration) Delete(
	ctx context.Context,
	appId string,
	integId string,
) error

Delete an integration.

func (*Integration) Get

func (integration *Integration) Get(
	ctx context.Context,
	appId string,
	integId string,
) (*models.IntegrationOut, error)

Get an integration.

func (*Integration) GetKey deprecated

func (integration *Integration) GetKey(
	ctx context.Context,
	appId string,
	integId string,
) (*models.IntegrationKeyOut, error)

Get an integration's key.

Deprecated: GetKey is deprecated.

func (*Integration) List

List the application's integrations.

func (*Integration) RotateKey

func (integration *Integration) RotateKey(
	ctx context.Context,
	appId string,
	integId string,
	o *IntegrationRotateKeyOptions,
) (*models.IntegrationKeyOut, error)

Rotate the integration's key. The previous key will be immediately revoked.

func (*Integration) Update

func (integration *Integration) Update(
	ctx context.Context,
	appId string,
	integId string,
	integrationUpdate models.IntegrationUpdate,
) (*models.IntegrationOut, error)

Update an integration.

type IntegrationCreateOptions added in v1.57.0

type IntegrationCreateOptions struct {
	IdempotencyKey *string
}

type IntegrationIn

type IntegrationIn = models.IntegrationIn

type IntegrationKeyOut

type IntegrationKeyOut = models.IntegrationKeyOut

type IntegrationListOptions

type IntegrationListOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
}

type IntegrationOut

type IntegrationOut = models.IntegrationOut

type IntegrationRotateKeyOptions added in v1.57.0

type IntegrationRotateKeyOptions struct {
	IdempotencyKey *string
}

type IntegrationUpdate

type IntegrationUpdate = models.IntegrationUpdate

type ListResponseApiTokenCensoredOut added in v1.63.1

type ListResponseApiTokenCensoredOut = models.ListResponseApiTokenCensoredOut

type ListResponseApplicationOut

type ListResponseApplicationOut = models.ListResponseApplicationOut

type ListResponseBackgroundTaskOut added in v1.4.12

type ListResponseBackgroundTaskOut = models.ListResponseBackgroundTaskOut

type ListResponseEndpointMessageOut

type ListResponseEndpointMessageOut = models.ListResponseEndpointMessageOut

type ListResponseEndpointOut

type ListResponseEndpointOut = models.ListResponseEndpointOut

type ListResponseEventTypeOut

type ListResponseEventTypeOut = models.ListResponseEventTypeOut

type ListResponseIngestEndpointOut added in v1.61.1

type ListResponseIngestEndpointOut = models.ListResponseIngestEndpointOut

type ListResponseIngestSourceOut added in v1.63.0

type ListResponseIngestSourceOut = models.ListResponseIngestSourceOut

type ListResponseIntegrationOut

type ListResponseIntegrationOut = models.ListResponseIntegrationOut

type ListResponseMessageAttemptOut

type ListResponseMessageAttemptOut = models.ListResponseMessageAttemptOut

type ListResponseMessageEndpointOut

type ListResponseMessageEndpointOut = models.ListResponseMessageEndpointOut

type ListResponseMessageOut

type ListResponseMessageOut = models.ListResponseMessageOut

type ListResponseOperationalWebhookEndpointOut added in v1.39.0

type ListResponseOperationalWebhookEndpointOut = models.ListResponseOperationalWebhookEndpointOut

type Management added in v1.63.1

type Management struct {
	Authentication *ManagementAuthentication
}

type ManagementAuthentication added in v1.63.1

type ManagementAuthentication struct {
	// contains filtered or unexported fields
}

func (*ManagementAuthentication) CreateApiToken added in v1.63.1

func (managementAuthentication *ManagementAuthentication) CreateApiToken(
	ctx context.Context,
	apiTokenIn models.ApiTokenIn,
	o *ManagementAuthenticationCreateApiTokenOptions,
) (*models.ApiTokenOut, error)

Create a new API Token.

func (*ManagementAuthentication) ExpireApiToken added in v1.63.1

func (managementAuthentication *ManagementAuthentication) ExpireApiToken(
	ctx context.Context,
	keyId string,
	apiTokenExpireIn models.ApiTokenExpireIn,
	o *ManagementAuthenticationExpireApiTokenOptions,
) error

Expire the selected API Token.

func (*ManagementAuthentication) ListApiTokens added in v1.63.1

List all API Tokens.

type ManagementAuthenticationCreateApiTokenOptions added in v1.63.1

type ManagementAuthenticationCreateApiTokenOptions struct {
	IdempotencyKey *string
}

type ManagementAuthenticationExpireApiTokenOptions added in v1.63.1

type ManagementAuthenticationExpireApiTokenOptions struct {
	IdempotencyKey *string
}

type ManagementAuthenticationListApiTokensOptions added in v1.63.1

type ManagementAuthenticationListApiTokensOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
}

type Message

type Message struct {
	Poller *MessagePoller
	// contains filtered or unexported fields
}

func (*Message) Create

func (message *Message) Create(
	ctx context.Context,
	appId string,
	messageIn models.MessageIn,
	o *MessageCreateOptions,
) (*models.MessageOut, error)

Creates a new message and dispatches it to all of the application's endpoints.

The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for the application, a 409 conflict error will be returned.

The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema.

The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to 1MiB, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.

func (*Message) ExpungeAllContents added in v1.58.2

func (message *Message) ExpungeAllContents(
	ctx context.Context,
	appId string,
	o *MessageExpungeAllContentsOptions,
) (*models.ExpungeAllContentsOut, error)

Delete all message payloads for the application.

This operation is only available in the <a href="https://svix.com/pricing" target="_blank">Enterprise</a> plan.

func (*Message) ExpungeContent added in v0.76.0

func (message *Message) ExpungeContent(
	ctx context.Context,
	appId string,
	msgId string,
) error

Delete the given message's payload.

Useful in cases when a message was accidentally sent with sensitive content. The message can't be replayed or resent once its payload has been deleted or expired.

func (*Message) Get

func (message *Message) Get(
	ctx context.Context,
	appId string,
	msgId string,
	o *MessageGetOptions,
) (*models.MessageOut, error)

Get a message by its ID or eventID.

func (*Message) List

func (message *Message) List(
	ctx context.Context,
	appId string,
	o *MessageListOptions,
) (*models.ListResponseMessageOut, error)

List all of the application's messages.

The `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results within a certain window.

Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.

type MessageAttempt

type MessageAttempt struct {
	// contains filtered or unexported fields
}

func (*MessageAttempt) ExpungeContent added in v0.76.0

func (messageAttempt *MessageAttempt) ExpungeContent(
	ctx context.Context,
	appId string,
	msgId string,
	attemptId string,
) error

Deletes the given attempt's response body.

Useful when an endpoint accidentally returned sensitive content. The message can't be replayed or resent once its payload has been deleted or expired.

func (*MessageAttempt) Get

func (messageAttempt *MessageAttempt) Get(
	ctx context.Context,
	appId string,
	msgId string,
	attemptId string,
) (*models.MessageAttemptOut, error)

`msg_id`: Use a message id or a message `eventId`

func (*MessageAttempt) ListAttemptedDestinations

func (messageAttempt *MessageAttempt) ListAttemptedDestinations(
	ctx context.Context,
	appId string,
	msgId string,
	o *MessageAttemptListAttemptedDestinationsOptions,
) (*models.ListResponseMessageEndpointOut, error)

List endpoints attempted by a given message.

Additionally includes metadata about the latest message attempt. By default, endpoints are listed in ascending order by ID.

func (*MessageAttempt) ListAttemptedMessages

func (messageAttempt *MessageAttempt) ListAttemptedMessages(
	ctx context.Context,
	appId string,
	endpointId string,
	o *MessageAttemptListAttemptedMessagesOptions,
) (*models.ListResponseEndpointMessageOut, error)

List messages for a particular endpoint. Additionally includes metadata about the latest message attempt.

The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.

Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.

func (*MessageAttempt) ListByEndpoint added in v0.48.0

func (messageAttempt *MessageAttempt) ListByEndpoint(
	ctx context.Context,
	appId string,
	endpointId string,
	o *MessageAttemptListByEndpointOptions,
) (*models.ListResponseMessageAttemptOut, error)

List attempts by endpoint id

Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.

func (*MessageAttempt) ListByMsg added in v0.48.0

List attempts by message ID.

Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.

func (*MessageAttempt) Resend

func (messageAttempt *MessageAttempt) Resend(
	ctx context.Context,
	appId string,
	msgId string,
	endpointId string,
	o *MessageAttemptResendOptions,
) error

Resend a message to the specified endpoint.

type MessageAttemptExhaustedEvent added in v1.63.0

type MessageAttemptExhaustedEvent = models.MessageAttemptExhaustedEvent

type MessageAttemptExhaustedEventData added in v1.63.0

type MessageAttemptExhaustedEventData = models.MessageAttemptExhaustedEventData

type MessageAttemptFailedData added in v1.63.0

type MessageAttemptFailedData = models.MessageAttemptFailedData

type MessageAttemptFailingEvent added in v1.63.0

type MessageAttemptFailingEvent = models.MessageAttemptFailingEvent

type MessageAttemptFailingEventData added in v1.63.0

type MessageAttemptFailingEventData = models.MessageAttemptFailingEventData

type MessageAttemptListAttemptedDestinationsOptions added in v1.57.0

type MessageAttemptListAttemptedDestinationsOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string
}

type MessageAttemptListAttemptedMessagesOptions added in v1.57.0

type MessageAttemptListAttemptedMessagesOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string
	// Filter response based on the channel
	Channel *string
	// Filter response based on the message tags
	Tag *string

	// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)
	Status *models.MessageStatus
	// Only include items created before a certain date
	Before *time.Time
	// Only include items created after a certain date
	After *time.Time
	// When `true` message payloads are included in the response
	WithContent *bool
	// Filter response based on the event type
	EventTypes *[]string
}

type MessageAttemptListByEndpointOptions added in v1.57.0

type MessageAttemptListByEndpointOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)
	Status *models.MessageStatus

	// Filter response based on the HTTP status code
	StatusCodeClass *models.StatusCodeClass
	// Filter response based on the channel
	Channel *string
	// Filter response based on the tag
	Tag *string
	// Only include items created before a certain date
	Before *time.Time
	// Only include items created after a certain date
	After *time.Time
	// When `true` attempt content is included in the response
	WithContent *bool
	// When `true`, the message information is included in the response
	WithMsg *bool
	// Filter response based on the event type
	EventTypes *[]string
}

type MessageAttemptListByMsgOptions added in v1.57.0

type MessageAttemptListByMsgOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)
	Status *models.MessageStatus

	// Filter response based on the HTTP status code
	StatusCodeClass *models.StatusCodeClass
	// Filter response based on the channel
	Channel *string
	// Filter response based on the tag
	Tag *string
	// Filter the attempts based on the attempted endpoint
	EndpointId *string
	// Only include items created before a certain date
	Before *time.Time
	// Only include items created after a certain date
	After *time.Time
	// When `true` attempt content is included in the response
	WithContent *bool
	// Filter response based on the event type
	EventTypes *[]string
}

type MessageAttemptOut

type MessageAttemptOut = models.MessageAttemptOut

type MessageAttemptRecoveredEvent added in v1.63.0

type MessageAttemptRecoveredEvent = models.MessageAttemptRecoveredEvent

type MessageAttemptRecoveredEventData added in v1.63.0

type MessageAttemptRecoveredEventData = models.MessageAttemptRecoveredEventData

type MessageAttemptResendOptions added in v1.57.0

type MessageAttemptResendOptions struct {
	IdempotencyKey *string
}

type MessageAttemptTriggerType added in v1.58.2

type MessageAttemptTriggerType = models.MessageAttemptTriggerType

type MessageCreateOptions added in v1.57.0

type MessageCreateOptions struct {
	// When `true`, message payloads are included in the response.
	WithContent    *bool
	IdempotencyKey *string
}

type MessageEndpointOut added in v0.83.0

type MessageEndpointOut = models.MessageEndpointOut

type MessageExpungeAllContentsOptions added in v1.58.2

type MessageExpungeAllContentsOptions struct {
	IdempotencyKey *string
}

type MessageGetOptions added in v1.57.0

type MessageGetOptions struct {
	// When `true` message payloads are included in the response.
	WithContent *bool
}

type MessageIn

type MessageIn = models.MessageIn

type MessageListOptions

type MessageListOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string
	// Filter response based on the channel.
	Channel *string
	// Only include items created before a certain date.
	Before *time.Time
	// Only include items created after a certain date.
	After *time.Time
	// When `true` message payloads are included in the response.
	WithContent *bool
	// Filter messages matching the provided tag.
	Tag *string
	// Filter response based on the event type
	EventTypes *[]string
}

type MessageOut

type MessageOut = models.MessageOut

type MessagePoller added in v1.64.1

type MessagePoller struct {
	// contains filtered or unexported fields
}

func (*MessagePoller) ConsumerPoll added in v1.64.1

func (messagePoller *MessagePoller) ConsumerPoll(
	ctx context.Context,
	appId string,
	sinkId string,
	consumerId string,
	o *MessagePollerConsumerPollOptions,
) (*models.PollingEndpointOut, error)

Reads the stream of created messages for an application, filtered on the Sink's event types and Channels, using server-managed iterator tracking.

func (*MessagePoller) ConsumerSeek added in v1.64.1

func (messagePoller *MessagePoller) ConsumerSeek(
	ctx context.Context,
	appId string,
	sinkId string,
	consumerId string,
	pollingEndpointConsumerSeekIn models.PollingEndpointConsumerSeekIn,
	o *MessagePollerConsumerSeekOptions,
) (*models.PollingEndpointConsumerSeekOut, error)

Sets the starting offset for the consumer of a polling endpoint.

func (*MessagePoller) Poll added in v1.64.1

func (messagePoller *MessagePoller) Poll(
	ctx context.Context,
	appId string,
	sinkId string,
	o *MessagePollerPollOptions,
) (*models.PollingEndpointOut, error)

Reads the stream of created messages for an application, filtered on the Sink's event types and Channels.

type MessagePollerConsumerPollOptions added in v1.64.1

type MessagePollerConsumerPollOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string
	// Filters messages sent with this event type (optional).
	EventType *string
	// Filters messages sent with this channel (optional).
	Channel *string
}

type MessagePollerConsumerSeekOptions added in v1.64.1

type MessagePollerConsumerSeekOptions struct {
	IdempotencyKey *string
}

type MessagePollerPollOptions added in v1.64.1

type MessagePollerPollOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string
	// Filters messages sent with this event type (optional).
	EventType *string
	// Filters messages sent with this channel (optional).
	Channel *string
	After   *time.Time
}

type MessageStatus

type MessageStatus = models.MessageStatus

type OperationalWebhook added in v1.63.0

type OperationalWebhook struct {
	Endpoint *OperationalWebhookEndpoint
}

type OperationalWebhookEndpoint added in v1.39.0

type OperationalWebhookEndpoint struct {
	// contains filtered or unexported fields
}

func (*OperationalWebhookEndpoint) Create added in v1.39.0

Create an operational webhook endpoint.

func (*OperationalWebhookEndpoint) Delete added in v1.39.0

func (operationalWebhookEndpoint *OperationalWebhookEndpoint) Delete(
	ctx context.Context,
	endpointId string,
) error

Delete an operational webhook endpoint.

func (*OperationalWebhookEndpoint) Get added in v1.39.0

func (operationalWebhookEndpoint *OperationalWebhookEndpoint) Get(
	ctx context.Context,
	endpointId string,
) (*models.OperationalWebhookEndpointOut, error)

Get an operational webhook endpoint.

func (*OperationalWebhookEndpoint) GetHeaders added in v1.57.0

func (operationalWebhookEndpoint *OperationalWebhookEndpoint) GetHeaders(
	ctx context.Context,
	endpointId string,
) (*models.OperationalWebhookEndpointHeadersOut, error)

Get the additional headers to be sent with the operational webhook.

func (*OperationalWebhookEndpoint) GetSecret added in v1.39.0

func (operationalWebhookEndpoint *OperationalWebhookEndpoint) GetSecret(
	ctx context.Context,
	endpointId string,
) (*models.OperationalWebhookEndpointSecretOut, error)

Get an operational webhook endpoint's signing secret.

This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).

func (*OperationalWebhookEndpoint) List added in v1.39.0

List operational webhook endpoints.

func (*OperationalWebhookEndpoint) RotateSecret added in v1.39.0

func (operationalWebhookEndpoint *OperationalWebhookEndpoint) RotateSecret(
	ctx context.Context,
	endpointId string,
	operationalWebhookEndpointSecretIn models.OperationalWebhookEndpointSecretIn,
	o *OperationalWebhookEndpointRotateSecretOptions,
) error

Rotates an operational webhook endpoint's signing secret.

The previous secret will remain valid for the next 24 hours.

func (*OperationalWebhookEndpoint) Update added in v1.39.0

func (operationalWebhookEndpoint *OperationalWebhookEndpoint) Update(
	ctx context.Context,
	endpointId string,
	operationalWebhookEndpointUpdate models.OperationalWebhookEndpointUpdate,
) (*models.OperationalWebhookEndpointOut, error)

Update an operational webhook endpoint.

func (*OperationalWebhookEndpoint) UpdateHeaders added in v1.57.0

func (operationalWebhookEndpoint *OperationalWebhookEndpoint) UpdateHeaders(
	ctx context.Context,
	endpointId string,
	operationalWebhookEndpointHeadersIn models.OperationalWebhookEndpointHeadersIn,
) error

Set the additional headers to be sent with the operational webhook.

type OperationalWebhookEndpointCreateOptions added in v1.57.0

type OperationalWebhookEndpointCreateOptions struct {
	IdempotencyKey *string
}

type OperationalWebhookEndpointHeadersIn added in v1.58.2

type OperationalWebhookEndpointHeadersIn = models.OperationalWebhookEndpointHeadersIn

type OperationalWebhookEndpointHeadersOut added in v1.58.2

type OperationalWebhookEndpointHeadersOut = models.OperationalWebhookEndpointHeadersOut

type OperationalWebhookEndpointIn added in v1.39.0

type OperationalWebhookEndpointIn = models.OperationalWebhookEndpointIn

type OperationalWebhookEndpointListOptions added in v1.39.0

type OperationalWebhookEndpointListOptions struct {
	// Limit the number of returned items
	Limit *uint64
	// The iterator returned from a prior invocation
	Iterator *string

	// The sorting order of the returned items
	Order *models.Ordering
}

type OperationalWebhookEndpointOut added in v1.39.0

type OperationalWebhookEndpointOut = models.OperationalWebhookEndpointOut

type OperationalWebhookEndpointRotateSecretOptions added in v1.57.0

type OperationalWebhookEndpointRotateSecretOptions struct {
	IdempotencyKey *string
}

type OperationalWebhookEndpointSecretIn added in v1.39.0

type OperationalWebhookEndpointSecretIn = models.OperationalWebhookEndpointSecretIn

type OperationalWebhookEndpointSecretOut added in v1.39.0

type OperationalWebhookEndpointSecretOut = models.OperationalWebhookEndpointSecretOut

type OperationalWebhookEndpointUpdate added in v1.39.0

type OperationalWebhookEndpointUpdate = models.OperationalWebhookEndpointUpdate

type Ordering added in v0.78.0

type Ordering = models.Ordering

type PollingEndpointConsumerSeekIn added in v1.63.0

type PollingEndpointConsumerSeekIn = models.PollingEndpointConsumerSeekIn

type PollingEndpointConsumerSeekOut added in v1.63.0

type PollingEndpointConsumerSeekOut = models.PollingEndpointConsumerSeekOut

type PollingEndpointMessageOut added in v1.63.0

type PollingEndpointMessageOut = models.PollingEndpointMessageOut

type PollingEndpointOut added in v1.63.0

type PollingEndpointOut = models.PollingEndpointOut

type RecoverIn

type RecoverIn = models.RecoverIn

type RecoverOut added in v1.29.0

type RecoverOut = models.RecoverOut

type ReplayIn added in v0.76.0

type ReplayIn = models.ReplayIn

type ReplayOut added in v1.29.0

type ReplayOut = models.ReplayOut

type RotateTokenOut added in v1.63.0

type RotateTokenOut = models.RotateTokenOut

type SegmentConfig added in v1.63.0

type SegmentConfig = models.SegmentConfig

type SegmentConfigOut added in v1.63.0

type SegmentConfigOut = models.SegmentConfigOut

type ShopifyConfig added in v1.63.0

type ShopifyConfig = models.ShopifyConfig

type ShopifyConfigOut added in v1.63.0

type ShopifyConfigOut = models.ShopifyConfigOut

type SlackConfig added in v1.63.0

type SlackConfig = models.SlackConfig

type SlackConfigOut added in v1.63.0

type SlackConfigOut = models.SlackConfigOut

type Statistics added in v1.14.0

type Statistics struct {
	// contains filtered or unexported fields
}

func (*Statistics) AggregateAppStats added in v1.14.0

func (statistics *Statistics) AggregateAppStats(
	ctx context.Context,
	appUsageStatsIn models.AppUsageStatsIn,
	o *StatisticsAggregateAppStatsOptions,
) (*models.AppUsageStatsOut, error)

Creates a background task to calculate the message destinations for all applications in the environment.

Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation.

func (*Statistics) AggregateEventTypes added in v1.14.0

func (statistics *Statistics) AggregateEventTypes(
	ctx context.Context,
) (*models.AggregateEventTypesOut, error)

Creates a background task to calculate the listed event types for all apps in the organization.

Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation.

type StatisticsAggregateAppStatsOptions added in v1.57.0

type StatisticsAggregateAppStatsOptions struct {
	IdempotencyKey *string
}

type StatusCodeClass added in v0.50.0

type StatusCodeClass = models.StatusCodeClass

type StripeConfig added in v1.63.0

type StripeConfig = models.StripeConfig

type StripeConfigOut added in v1.63.0

type StripeConfigOut = models.StripeConfigOut

type Svix

type Svix struct {
	Authentication             *Authentication
	Application                *Application
	Endpoint                   *Endpoint
	Environment                *Environment
	EventType                  *EventType
	Ingest                     *Ingest
	Integration                *Integration
	Management                 *Management
	Message                    *Message
	MessageAttempt             *MessageAttempt
	Statistics                 *Statistics
	OperationalWebhook         *OperationalWebhook
	OperationalWebhookEndpoint *OperationalWebhookEndpoint
}

func New

func New(token string, options *SvixOptions) (*Svix, error)

type SvixConfig added in v1.63.0

type SvixConfig = models.SvixConfig

type SvixConfigOut added in v1.63.0

type SvixConfigOut = models.SvixConfigOut

type SvixOptions

type SvixOptions struct {
	ServerUrl     *url.URL
	HTTPClient    *http.Client
	RetrySchedule *[]time.Duration
	Debug         bool
}

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

func NewWebhook

func NewWebhook(secret string) (*Webhook, error)

func NewWebhookRaw added in v0.63.0

func NewWebhookRaw(secret []byte) (*Webhook, error)

func (*Webhook) Sign

func (wh *Webhook) Sign(msgId string, timestamp time.Time, payload []byte) (string, error)

func (*Webhook) Verify

func (wh *Webhook) Verify(payload []byte, headers http.Header) error

Verify validates the payload against the svix signature headers using the webhooks signing secret.

Returns an error if the body or headers are missing/unreadable or if the signature doesn't match.

func (*Webhook) VerifyIgnoringTimestamp

func (wh *Webhook) VerifyIgnoringTimestamp(payload []byte, headers http.Header) error

VerifyIgnoringTimestamp validates the payload against the svix signature headers using the webhooks signing secret.

Returns an error if the body or headers are missing/unreadable or if the signature doesn't match.

WARNING: This function does not check the signature's timestamp. We recommend using the `Verify` function instead.

type ZoomConfig added in v1.63.0

type ZoomConfig = models.ZoomConfig

type ZoomConfigOut added in v1.63.0

type ZoomConfigOut = models.ZoomConfigOut

Directories

Path Synopsis
Package internalapi, DO NOT USE THIS FILE, THE API WILL CHANGE WITHOUT WARNING!!!!
Package internalapi, DO NOT USE THIS FILE, THE API WILL CHANGE WITHOUT WARNING!!!!
Package svix this file is @generated DO NOT EDIT
Package svix this file is @generated DO NOT EDIT

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL