Documentation
¶
Overview ¶
Package external implements the /api surface: the public API, authenticated by a Workspace's bearer API token.
Index ¶
- type AuditLog
- type Deps
- type ExportStreams
- type Handlers
- func (h *Handlers) AuditEntriesList(ctx context.Context, params externalapi.AuditEntriesListParams) (externalapi.AuditEntriesListRes, error)
- func (h *Handlers) AuthMeGet(ctx context.Context) (externalapi.AuthMeGetRes, error)
- func (h *Handlers) AuthTokensBootstrap(ctx context.Context, req *externalapi.CreateApiTokenInput, ...) (externalapi.AuthTokensBootstrapRes, error)
- func (h *Handlers) AuthTokensCreate(ctx context.Context, req *externalapi.CreateApiTokenInput) (externalapi.AuthTokensCreateRes, error)
- func (h *Handlers) AuthTokensDelete(ctx context.Context, params externalapi.AuthTokensDeleteParams) (externalapi.AuthTokensDeleteRes, error)
- func (h *Handlers) AuthTokensList(ctx context.Context) (externalapi.AuthTokensListRes, error)
- func (h *Handlers) AutomationsActivate(ctx context.Context, params externalapi.AutomationsActivateParams) (externalapi.AutomationsActivateRes, error)
- func (h *Handlers) AutomationsArchive(ctx context.Context, params externalapi.AutomationsArchiveParams) (externalapi.AutomationsArchiveRes, error)
- func (h *Handlers) AutomationsCreate(ctx context.Context, req *externalapi.CreateAutomationInput) (externalapi.AutomationsCreateRes, error)
- func (h *Handlers) AutomationsDeactivate(ctx context.Context, params externalapi.AutomationsDeactivateParams) (externalapi.AutomationsDeactivateRes, error)
- func (h *Handlers) AutomationsDelete(ctx context.Context, params externalapi.AutomationsDeleteParams) (externalapi.AutomationsDeleteRes, error)
- func (h *Handlers) AutomationsDryRunHttpStep(ctx context.Context, req *externalapi.DryRunHttpStepInput) (externalapi.AutomationsDryRunHttpStepRes, error)
- func (h *Handlers) AutomationsGet(ctx context.Context, params externalapi.AutomationsGetParams) (externalapi.AutomationsGetRes, error)
- func (h *Handlers) AutomationsList(ctx context.Context, params externalapi.AutomationsListParams) (externalapi.AutomationsListRes, error)
- func (h *Handlers) AutomationsUnarchive(ctx context.Context, params externalapi.AutomationsUnarchiveParams) (externalapi.AutomationsUnarchiveRes, error)
- func (h *Handlers) AutomationsUpdate(ctx context.Context, req *externalapi.UpdateAutomationInput, ...) (externalapi.AutomationsUpdateRes, error)
- func (h *Handlers) BrandKitGet(ctx context.Context) (externalapi.BrandKitGetRes, error)
- func (h *Handlers) BroadcastsArchive(ctx context.Context, params externalapi.BroadcastsArchiveParams) (externalapi.BroadcastsArchiveRes, error)
- func (h *Handlers) BroadcastsCreate(ctx context.Context, req *externalapi.CreateBroadcastInput) (externalapi.BroadcastsCreateRes, error)
- func (h *Handlers) BroadcastsDelete(ctx context.Context, params externalapi.BroadcastsDeleteParams) (externalapi.BroadcastsDeleteRes, error)
- func (h *Handlers) BroadcastsGet(ctx context.Context, params externalapi.BroadcastsGetParams) (externalapi.BroadcastsGetRes, error)
- func (h *Handlers) BroadcastsList(ctx context.Context, params externalapi.BroadcastsListParams) (externalapi.BroadcastsListRes, error)
- func (h *Handlers) BroadcastsReport(ctx context.Context, params externalapi.BroadcastsReportParams) (externalapi.BroadcastsReportRes, error)
- func (h *Handlers) BroadcastsSchedule(ctx context.Context, req *externalapi.ScheduleBroadcastInput, ...) (externalapi.BroadcastsScheduleRes, error)
- func (h *Handlers) BroadcastsSetSegment(ctx context.Context, req *externalapi.SetBroadcastSegmentInput, ...) (externalapi.BroadcastsSetSegmentRes, error)
- func (h *Handlers) BroadcastsTestSend(ctx context.Context, req *externalapi.TestSendBroadcastInput, ...) (externalapi.BroadcastsTestSendRes, error)
- func (h *Handlers) BroadcastsUnarchive(ctx context.Context, params externalapi.BroadcastsUnarchiveParams) (externalapi.BroadcastsUnarchiveRes, error)
- func (h *Handlers) BroadcastsUnschedule(ctx context.Context, params externalapi.BroadcastsUnscheduleParams) (externalapi.BroadcastsUnscheduleRes, error)
- func (h *Handlers) BroadcastsUpdate(ctx context.Context, req *externalapi.UpdateBroadcastInput, ...) (externalapi.BroadcastsUpdateRes, error)
- func (h *Handlers) CapturedMessagesDelete(ctx context.Context, params externalapi.CapturedMessagesDeleteParams) (externalapi.CapturedMessagesDeleteRes, error)
- func (h *Handlers) CapturedMessagesDeleteAll(ctx context.Context) (externalapi.CapturedMessagesDeleteAllRes, error)
- func (h *Handlers) CapturedMessagesGet(ctx context.Context, params externalapi.CapturedMessagesGetParams) (externalapi.CapturedMessagesGetRes, error)
- func (h *Handlers) CapturedMessagesList(ctx context.Context, params externalapi.CapturedMessagesListParams) (externalapi.CapturedMessagesListRes, error)
- func (h *Handlers) ContactsBatchUpsert(ctx context.Context, req *externalapi.UpsertContactsInput) (externalapi.ContactsBatchUpsertRes, error)
- func (h *Handlers) ContactsCreate(ctx context.Context, req *externalapi.CreateContactInput) (externalapi.ContactsCreateRes, error)
- func (h *Handlers) ContactsDelete(ctx context.Context, params externalapi.ContactsDeleteParams) (externalapi.ContactsDeleteRes, error)
- func (h *Handlers) ContactsEraseBy(ctx context.Context, params externalapi.ContactsEraseByParams) (externalapi.ContactsEraseByRes, error)
- func (h *Handlers) ContactsExport(ctx context.Context, params externalapi.ContactsExportParams) (externalapi.ContactsExportRes, error)
- func (h *Handlers) ContactsGet(ctx context.Context, params externalapi.ContactsGetParams) (externalapi.ContactsGetRes, error)
- func (h *Handlers) ContactsList(ctx context.Context, params externalapi.ContactsListParams) (externalapi.ContactsListRes, error)
- func (h *Handlers) ContactsUpdate(ctx context.Context, req *externalapi.UpdateContactInput, ...) (externalapi.ContactsUpdateRes, error)
- func (h *Handlers) CustomFieldsList(ctx context.Context) (externalapi.CustomFieldsListRes, error)
- func (h *Handlers) EmailLintLint(ctx context.Context, req *externalapi.LintEmailInput) (externalapi.EmailLintLintRes, error)
- func (h *Handlers) EmailSchemaGet(ctx context.Context) (externalapi.EmailSchemaGetRes, error)
- func (h *Handlers) EmailsSend(ctx context.Context, req *externalapi.SendTransactionalEmailInput, ...) (externalapi.EmailsSendRes, error)
- func (h *Handlers) EnrollmentsGet(ctx context.Context, params externalapi.EnrollmentsGetParams) (externalapi.EnrollmentsGetRes, error)
- func (h *Handlers) EnrollmentsList(ctx context.Context, params externalapi.EnrollmentsListParams) (externalapi.EnrollmentsListRes, error)
- func (h *Handlers) EventActionsList(ctx context.Context, params externalapi.EventActionsListParams) (externalapi.EventActionsListRes, error)
- func (h *Handlers) EventsBatchSubmit(ctx context.Context, req *externalapi.RecordEventsBatchInput) (externalapi.EventsBatchSubmitRes, error)
- func (h *Handlers) EventsCreate(ctx context.Context, req *externalapi.RecordEventsInput) (externalapi.EventsCreateRes, error)
- func (h *Handlers) ExportAudit(ctx context.Context, params externalapi.ExportAuditParams) (externalapi.ExportAuditRes, error)
- func (h *Handlers) ExportContacts(ctx context.Context, params externalapi.ExportContactsParams) (externalapi.ExportContactsRes, error)
- func (h *Handlers) ExportErasures(ctx context.Context, params externalapi.ExportErasuresParams) (externalapi.ExportErasuresRes, error)
- func (h *Handlers) ExportEvents(ctx context.Context, params externalapi.ExportEventsParams) (externalapi.ExportEventsRes, error)
- func (h *Handlers) ExportMessages(ctx context.Context, params externalapi.ExportMessagesParams) (externalapi.ExportMessagesRes, error)
- func (h *Handlers) IntegrationsArchive(ctx context.Context, params externalapi.IntegrationsArchiveParams) (externalapi.IntegrationsArchiveRes, error)
- func (h *Handlers) IntegrationsCreate(ctx context.Context, req *externalapi.CreateIntegrationInput) (externalapi.IntegrationsCreateRes, error)
- func (h *Handlers) IntegrationsGet(ctx context.Context, params externalapi.IntegrationsGetParams) (externalapi.IntegrationsGetRes, error)
- func (h *Handlers) IntegrationsList(ctx context.Context, params externalapi.IntegrationsListParams) (externalapi.IntegrationsListRes, error)
- func (h *Handlers) IntegrationsRegenerateKey(ctx context.Context, params externalapi.IntegrationsRegenerateKeyParams) (externalapi.IntegrationsRegenerateKeyRes, error)
- func (h *Handlers) IntegrationsUnarchive(ctx context.Context, params externalapi.IntegrationsUnarchiveParams) (externalapi.IntegrationsUnarchiveRes, error)
- func (h *Handlers) IntegrationsUpdate(ctx context.Context, req *externalapi.UpdateIntegrationInput, ...) (externalapi.IntegrationsUpdateRes, error)
- func (h *Handlers) PresetsList(ctx context.Context) (externalapi.PresetsListRes, error)
- func (h *Handlers) RuleFiringsList(ctx context.Context, params externalapi.RuleFiringsListParams) (externalapi.RuleFiringsListRes, error)
- func (h *Handlers) RulesActivate(ctx context.Context, params externalapi.RulesActivateParams) (externalapi.RulesActivateRes, error)
- func (h *Handlers) RulesArchive(ctx context.Context, params externalapi.RulesArchiveParams) (externalapi.RulesArchiveRes, error)
- func (h *Handlers) RulesCreate(ctx context.Context, req *externalapi.CreateRuleInput) (externalapi.RulesCreateRes, error)
- func (h *Handlers) RulesDeactivate(ctx context.Context, params externalapi.RulesDeactivateParams) (externalapi.RulesDeactivateRes, error)
- func (h *Handlers) RulesDelete(ctx context.Context, params externalapi.RulesDeleteParams) (externalapi.RulesDeleteRes, error)
- func (h *Handlers) RulesDryRun(ctx context.Context, req *externalapi.DryRunRuleInput, ...) (externalapi.RulesDryRunRes, error)
- func (h *Handlers) RulesGet(ctx context.Context, params externalapi.RulesGetParams) (externalapi.RulesGetRes, error)
- func (h *Handlers) RulesList(ctx context.Context, params externalapi.RulesListParams) (externalapi.RulesListRes, error)
- func (h *Handlers) RulesUnarchive(ctx context.Context, params externalapi.RulesUnarchiveParams) (externalapi.RulesUnarchiveRes, error)
- func (h *Handlers) RulesUpdate(ctx context.Context, req *externalapi.UpdateRuleInput, ...) (externalapi.RulesUpdateRes, error)
- func (h *Handlers) SegmentsArchive(ctx context.Context, params externalapi.SegmentsArchiveParams) (externalapi.SegmentsArchiveRes, error)
- func (h *Handlers) SegmentsCreate(ctx context.Context, req *externalapi.CreateSegmentInput) (externalapi.SegmentsCreateRes, error)
- func (h *Handlers) SegmentsGet(ctx context.Context, params externalapi.SegmentsGetParams) (externalapi.SegmentsGetRes, error)
- func (h *Handlers) SegmentsList(ctx context.Context, params externalapi.SegmentsListParams) (externalapi.SegmentsListRes, error)
- func (h *Handlers) SegmentsPreview(ctx context.Context, req *externalapi.PreviewSegmentInput) (externalapi.SegmentsPreviewRes, error)
- func (h *Handlers) SegmentsUnarchive(ctx context.Context, params externalapi.SegmentsUnarchiveParams) (externalapi.SegmentsUnarchiveRes, error)
- func (h *Handlers) SegmentsUpdate(ctx context.Context, req *externalapi.UpdateSegmentInput, ...) (externalapi.SegmentsUpdateRes, error)
- func (h *Handlers) SendingDomainRatesList(ctx context.Context, params externalapi.SendingDomainRatesListParams) (externalapi.SendingDomainRatesListRes, error)
- func (h *Handlers) SendingDomainsArchive(ctx context.Context, params externalapi.SendingDomainsArchiveParams) (externalapi.SendingDomainsArchiveRes, error)
- func (h *Handlers) SendingDomainsCreate(ctx context.Context, req *externalapi.CreateSendingDomainInput) (externalapi.SendingDomainsCreateRes, error)
- func (h *Handlers) SendingDomainsGet(ctx context.Context, params externalapi.SendingDomainsGetParams) (externalapi.SendingDomainsGetRes, error)
- func (h *Handlers) SendingDomainsList(ctx context.Context, params externalapi.SendingDomainsListParams) (externalapi.SendingDomainsListRes, error)
- func (h *Handlers) SendingDomainsUnarchive(ctx context.Context, params externalapi.SendingDomainsUnarchiveParams) (externalapi.SendingDomainsUnarchiveRes, error)
- func (h *Handlers) SendingDomainsUpdate(ctx context.Context, req *externalapi.UpdateSendingDomainInput, ...) (externalapi.SendingDomainsUpdateRes, error)
- func (h *Handlers) SendingDomainsVerify(ctx context.Context, params externalapi.SendingDomainsVerifyParams) (externalapi.SendingDomainsVerifyRes, error)
- func (h *Handlers) SuppressionsCreate(ctx context.Context, req *externalapi.CreateSuppressionInput) (externalapi.SuppressionsCreateRes, error)
- func (h *Handlers) TagsApply(ctx context.Context, req *externalapi.ApplyTagInput, ...) (externalapi.TagsApplyRes, error)
- func (h *Handlers) TagsDelete(ctx context.Context, params externalapi.TagsDeleteParams) (externalapi.TagsDeleteRes, error)
- func (h *Handlers) TagsList(ctx context.Context, params externalapi.TagsListParams) (externalapi.TagsListRes, error)
- func (h *Handlers) TagsListForContact(ctx context.Context, params externalapi.TagsListForContactParams) (externalapi.TagsListForContactRes, error)
- func (h *Handlers) TagsRemove(ctx context.Context, params externalapi.TagsRemoveParams) (externalapi.TagsRemoveRes, error)
- func (h *Handlers) TemplatesCreate(ctx context.Context, req *externalapi.CreateTemplateInput) (externalapi.TemplatesCreateRes, error)
- func (h *Handlers) TemplatesDelete(ctx context.Context, params externalapi.TemplatesDeleteParams) (externalapi.TemplatesDeleteRes, error)
- func (h *Handlers) TemplatesGet(ctx context.Context, params externalapi.TemplatesGetParams) (externalapi.TemplatesGetRes, error)
- func (h *Handlers) TemplatesList(ctx context.Context, params externalapi.TemplatesListParams) (externalapi.TemplatesListRes, error)
- func (h *Handlers) TemplatesUpdate(ctx context.Context, req *externalapi.UpdateTemplateInput, ...) (externalapi.TemplatesUpdateRes, error)
- func (h *Handlers) UnsubscribesCreate(ctx context.Context, req *externalapi.CreateUnsubscribeInput) (externalapi.UnsubscribesCreateRes, error)
- func (h *Handlers) WebhooksCreate(ctx context.Context, req *externalapi.CreateWebhookInput) (externalapi.WebhooksCreateRes, error)
- func (h *Handlers) WebhooksDelete(ctx context.Context, params externalapi.WebhooksDeleteParams) (externalapi.WebhooksDeleteRes, error)
- func (h *Handlers) WebhooksGet(ctx context.Context, params externalapi.WebhooksGetParams) (externalapi.WebhooksGetRes, error)
- func (h *Handlers) WebhooksList(ctx context.Context, params externalapi.WebhooksListParams) (externalapi.WebhooksListRes, error)
- func (h *Handlers) WebhooksRegenerateSecret(ctx context.Context, params externalapi.WebhooksRegenerateSecretParams) (externalapi.WebhooksRegenerateSecretRes, error)
- func (h *Handlers) WebhooksTest(ctx context.Context, req *externalapi.TestWebhookInput, ...) (externalapi.WebhooksTestRes, error)
- func (h *Handlers) WebhooksUpdate(ctx context.Context, req *externalapi.UpdateWebhookInput, ...) (externalapi.WebhooksUpdateRes, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLog ¶
type AuditLog interface {
Licensed() bool
// Entries returns up to limit entries, newest first, preceding the cursor entry
// id (0 = from the newest), and the next page's cursor (0 = last page).
Entries(ctx context.Context, s *ent.Scoped, f events.AuditFilter, cursor int64, limit int) ([]*ent.AuditEntry, int64, error)
}
AuditLog is the read seam of the Enterprise Audit log (ADR 0022), implemented by ee/audit. Core knows only this interface: without a license Licensed is false and the read answers 402.
type Deps ¶
type Deps struct {
Accounts *accounts.Accounts
Bus *events.Bus
Webhooks *webhooks.Module
Integrations *integrations.Module
// CapturedMessages is the store of what the Workspace's Test inbox kept.
CapturedMessages *capturedmessages.Module
SendingDomains *sendingdomains.Module
Outbound *outbound.Module
Segments *segments.Module
EventLog *eventlog.Module
Contacts *contacts.Module
Erasure *erasure.Module
Tags *tags.Module
Templates *templates.Module
Transactional *transactional.Module
BrandKit *brandkit.Module
Automations *automations.Module
Rules *rules.Module
Broadcasts *broadcasts.Module
Reputation *reputation.Module
BootstrapToken string
Audit AuditLog
Export ExportStreams
}
Deps is everything the /api handlers are built from. The domain modules are the shared singletons the composition root registers once, so /api and /site cannot diverge on how a module is constructed.
type ExportStreams ¶
type ExportStreams interface {
Licensed() bool
}
ExportStreams is the license seam of the Enterprise Export streams (ADR 0045), implemented by ee/export. Core serves the streams itself (internal/exportstream) and asks only whether the `export` feature is licensed: without it every stream answers 404.
type Handlers ¶
type Handlers struct {
externalapi.UnimplementedHandler
// contains filtered or unexported fields
}
func NewHandlers ¶
func (*Handlers) AuditEntriesList ¶
func (h *Handlers) AuditEntriesList(ctx context.Context, params externalapi.AuditEntriesListParams) (externalapi.AuditEntriesListRes, error)
AuditEntriesList reads the Workspace's Audit log, newest first, for a token with the audit:read scope (a SIEM feed). An instance without an Enterprise license answers 402 (ADR 0014, ADR 0022).
func (*Handlers) AuthMeGet ¶
func (h *Handlers) AuthMeGet(ctx context.Context) (externalapi.AuthMeGetRes, error)
func (*Handlers) AuthTokensBootstrap ¶
func (h *Handlers) AuthTokensBootstrap(ctx context.Context, req *externalapi.CreateApiTokenInput, params externalapi.AuthTokensBootstrapParams) (externalapi.AuthTokensBootstrapRes, error)
func (*Handlers) AuthTokensCreate ¶
func (h *Handlers) AuthTokensCreate(ctx context.Context, req *externalapi.CreateApiTokenInput) (externalapi.AuthTokensCreateRes, error)
func (*Handlers) AuthTokensDelete ¶
func (h *Handlers) AuthTokensDelete(ctx context.Context, params externalapi.AuthTokensDeleteParams) (externalapi.AuthTokensDeleteRes, error)
func (*Handlers) AuthTokensList ¶
func (h *Handlers) AuthTokensList(ctx context.Context) (externalapi.AuthTokensListRes, error)
func (*Handlers) AutomationsActivate ¶
func (h *Handlers) AutomationsActivate(ctx context.Context, params externalapi.AutomationsActivateParams) (externalapi.AutomationsActivateRes, error)
AutomationsActivate and AutomationsDeactivate need automations:activate, which authoring scopes never imply (ADR 0016). Over MCP, activate additionally needs mcp:send (the x-mcp send flag).
func (*Handlers) AutomationsArchive ¶
func (h *Handlers) AutomationsArchive(ctx context.Context, params externalapi.AutomationsArchiveParams) (externalapi.AutomationsArchiveRes, error)
AutomationsArchive archives an automation (ADR 0049); active enrollments refuse it with 409.
func (*Handlers) AutomationsCreate ¶
func (h *Handlers) AutomationsCreate(ctx context.Context, req *externalapi.CreateAutomationInput) (externalapi.AutomationsCreateRes, error)
AutomationsCreate always stores a draft: activating is the send-class operation.
func (*Handlers) AutomationsDeactivate ¶
func (h *Handlers) AutomationsDeactivate(ctx context.Context, params externalapi.AutomationsDeactivateParams) (externalapi.AutomationsDeactivateRes, error)
func (*Handlers) AutomationsDelete ¶
func (h *Handlers) AutomationsDelete(ctx context.Context, params externalapi.AutomationsDeleteParams) (externalapi.AutomationsDeleteRes, error)
func (*Handlers) AutomationsDryRunHttpStep ¶
func (h *Handlers) AutomationsDryRunHttpStep(ctx context.Context, req *externalapi.DryRunHttpStepInput) (externalapi.AutomationsDryRunHttpStepRes, error)
AutomationsDryRunHttpStep renders an HTTP step's body for a Contact and validates it; nothing is called. It reads a Contact, so it needs both scopes.
func (*Handlers) AutomationsGet ¶
func (h *Handlers) AutomationsGet(ctx context.Context, params externalapi.AutomationsGetParams) (externalapi.AutomationsGetRes, error)
func (*Handlers) AutomationsList ¶
func (h *Handlers) AutomationsList(ctx context.Context, params externalapi.AutomationsListParams) (externalapi.AutomationsListRes, error)
func (*Handlers) AutomationsUnarchive ¶
func (h *Handlers) AutomationsUnarchive(ctx context.Context, params externalapi.AutomationsUnarchiveParams) (externalapi.AutomationsUnarchiveRes, error)
AutomationsUnarchive restores an archived automation.
func (*Handlers) AutomationsUpdate ¶
func (h *Handlers) AutomationsUpdate(ctx context.Context, req *externalapi.UpdateAutomationInput, params externalapi.AutomationsUpdateParams) (externalapi.AutomationsUpdateRes, error)
func (*Handlers) BrandKitGet ¶
func (h *Handlers) BrandKitGet(ctx context.Context) (externalapi.BrandKitGetRes, error)
BrandKitGet returns the Workspace's Brand kit for an agent to write a message in (ADR 0040). It needs only the right to read Templates; the Brand kit is never written over /api.
func (*Handlers) BroadcastsArchive ¶
func (h *Handlers) BroadcastsArchive(ctx context.Context, params externalapi.BroadcastsArchiveParams) (externalapi.BroadcastsArchiveRes, error)
BroadcastsArchive archives a sent or failed broadcast (ADR 0049).
func (*Handlers) BroadcastsCreate ¶
func (h *Handlers) BroadcastsCreate(ctx context.Context, req *externalapi.CreateBroadcastInput) (externalapi.BroadcastsCreateRes, error)
func (*Handlers) BroadcastsDelete ¶
func (h *Handlers) BroadcastsDelete(ctx context.Context, params externalapi.BroadcastsDeleteParams) (externalapi.BroadcastsDeleteRes, error)
func (*Handlers) BroadcastsGet ¶
func (h *Handlers) BroadcastsGet(ctx context.Context, params externalapi.BroadcastsGetParams) (externalapi.BroadcastsGetRes, error)
func (*Handlers) BroadcastsList ¶
func (h *Handlers) BroadcastsList(ctx context.Context, params externalapi.BroadcastsListParams) (externalapi.BroadcastsListRes, error)
func (*Handlers) BroadcastsReport ¶
func (h *Handlers) BroadcastsReport(ctx context.Context, params externalapi.BroadcastsReportParams) (externalapi.BroadcastsReportRes, error)
func (*Handlers) BroadcastsSchedule ¶
func (h *Handlers) BroadcastsSchedule(ctx context.Context, req *externalapi.ScheduleBroadcastInput, params externalapi.BroadcastsScheduleParams) (externalapi.BroadcastsScheduleRes, error)
BroadcastsSchedule and BroadcastsUnschedule are send-class (ADR 0016, "Send is a second lock"): they need broadcasts:send, which authoring scopes never imply. Over MCP they additionally need mcp:send (the x-mcp send flag).
func (*Handlers) BroadcastsSetSegment ¶
func (h *Handlers) BroadcastsSetSegment(ctx context.Context, req *externalapi.SetBroadcastSegmentInput, params externalapi.BroadcastsSetSegmentParams) (externalapi.BroadcastsSetSegmentRes, error)
func (*Handlers) BroadcastsTestSend ¶
func (h *Handlers) BroadcastsTestSend(ctx context.Context, req *externalapi.TestSendBroadcastInput, params externalapi.BroadcastsTestSendParams) (externalapi.BroadcastsTestSendRes, error)
BroadcastsTestSend renders the broadcast with sample merge data and sends it to one address: no recipient rows, no tracking, never the audience.
func (*Handlers) BroadcastsUnarchive ¶
func (h *Handlers) BroadcastsUnarchive(ctx context.Context, params externalapi.BroadcastsUnarchiveParams) (externalapi.BroadcastsUnarchiveRes, error)
BroadcastsUnarchive restores an archived broadcast.
func (*Handlers) BroadcastsUnschedule ¶
func (h *Handlers) BroadcastsUnschedule(ctx context.Context, params externalapi.BroadcastsUnscheduleParams) (externalapi.BroadcastsUnscheduleRes, error)
func (*Handlers) BroadcastsUpdate ¶
func (h *Handlers) BroadcastsUpdate(ctx context.Context, req *externalapi.UpdateBroadcastInput, params externalapi.BroadcastsUpdateParams) (externalapi.BroadcastsUpdateRes, error)
func (*Handlers) CapturedMessagesDelete ¶
func (h *Handlers) CapturedMessagesDelete(ctx context.Context, params externalapi.CapturedMessagesDeleteParams) (externalapi.CapturedMessagesDeleteRes, error)
CapturedMessagesDelete deletes one Captured message.
func (*Handlers) CapturedMessagesDeleteAll ¶
func (h *Handlers) CapturedMessagesDeleteAll(ctx context.Context) (externalapi.CapturedMessagesDeleteAllRes, error)
CapturedMessagesDeleteAll deletes every Captured message of the Workspace.
func (*Handlers) CapturedMessagesGet ¶
func (h *Handlers) CapturedMessagesGet(ctx context.Context, params externalapi.CapturedMessagesGetParams) (externalapi.CapturedMessagesGetRes, error)
CapturedMessagesGet returns one Captured message in full.
func (*Handlers) CapturedMessagesList ¶
func (h *Handlers) CapturedMessagesList(ctx context.Context, params externalapi.CapturedMessagesListParams) (externalapi.CapturedMessagesListRes, error)
CapturedMessagesList returns the Workspace's Captured messages, newest first, without content.
func (*Handlers) ContactsBatchUpsert ¶
func (h *Handlers) ContactsBatchUpsert(ctx context.Context, req *externalapi.UpsertContactsInput) (externalapi.ContactsBatchUpsertRes, error)
ContactsBatchUpsert upserts each Contact independently and reports a per-item result.
func (*Handlers) ContactsCreate ¶
func (h *Handlers) ContactsCreate(ctx context.Context, req *externalapi.CreateContactInput) (externalapi.ContactsCreateRes, error)
func (*Handlers) ContactsDelete ¶
func (h *Handlers) ContactsDelete(ctx context.Context, params externalapi.ContactsDeleteParams) (externalapi.ContactsDeleteRes, error)
ContactsDelete is Erasure (ADR 0021): deleting a Contact removes its personal data. It has its own scope, separate from contacts:write, because it is irreversible.
func (*Handlers) ContactsEraseBy ¶
func (h *Handlers) ContactsEraseBy(ctx context.Context, params externalapi.ContactsEraseByParams) (externalapi.ContactsEraseByRes, error)
ContactsEraseBy is Erasure by an email address or a visitor id (ADR 0021), under the same scope and rules as deleting by id. Exactly one identifier is required.
func (*Handlers) ContactsExport ¶
func (h *Handlers) ContactsExport(ctx context.Context, params externalapi.ContactsExportParams) (externalapi.ContactsExportRes, error)
ContactsExport streams the subject-access Data export of one contact (ADR 0021), needing only the contact read scope.
func (*Handlers) ContactsGet ¶
func (h *Handlers) ContactsGet(ctx context.Context, params externalapi.ContactsGetParams) (externalapi.ContactsGetRes, error)
func (*Handlers) ContactsList ¶
func (h *Handlers) ContactsList(ctx context.Context, params externalapi.ContactsListParams) (externalapi.ContactsListRes, error)
func (*Handlers) ContactsUpdate ¶
func (h *Handlers) ContactsUpdate(ctx context.Context, req *externalapi.UpdateContactInput, params externalapi.ContactsUpdateParams) (externalapi.ContactsUpdateRes, error)
func (*Handlers) CustomFieldsList ¶
func (h *Handlers) CustomFieldsList(ctx context.Context) (externalapi.CustomFieldsListRes, error)
CustomFieldsList returns the whole (small, unpaginated) Custom field catalogue.
func (*Handlers) EmailLintLint ¶
func (h *Handlers) EmailLintLint(ctx context.Context, req *externalapi.LintEmailInput) (externalapi.EmailLintLintRes, error)
EmailLintLint lints a message without saving it (ADR 0040): the one lint of the save paths and the send planner, with the Workspace's Brand kit. What cannot render is an error; everything else is a warning. It needs only the right to read Templates, as it stores nothing.
func (*Handlers) EmailSchemaGet ¶
func (h *Handlers) EmailSchemaGet(ctx context.Context) (externalapi.EmailSchemaGetRes, error)
EmailSchemaGet describes the editor's document to an agent (ADR 0040): the structure the editor derives, with the attribute rules the server checks. It holds no Workspace data and needs only the right to read Templates.
func (*Handlers) EmailsSend ¶
func (h *Handlers) EmailsSend(ctx context.Context, req *externalapi.SendTransactionalEmailInput, params externalapi.EmailsSendParams) (externalapi.EmailsSendRes, error)
EmailsSend is the transactional send surface (ADR 0005). The whole operation is the transactional module's; this handler only unpacks the request, calls it and renders its Result as the HTTP contract. The optional Idempotency-Key becomes the send's claim key: a repeated key replays the recorded outcome instead of sending again, and a key whose first request is still in flight returns 409.
func (*Handlers) EnrollmentsGet ¶
func (h *Handlers) EnrollmentsGet(ctx context.Context, params externalapi.EnrollmentsGetParams) (externalapi.EnrollmentsGetRes, error)
func (*Handlers) EnrollmentsList ¶
func (h *Handlers) EnrollmentsList(ctx context.Context, params externalapi.EnrollmentsListParams) (externalapi.EnrollmentsListRes, error)
func (*Handlers) EventActionsList ¶
func (h *Handlers) EventActionsList(ctx context.Context, params externalapi.EventActionsListParams) (externalapi.EventActionsListRes, error)
func (*Handlers) EventsBatchSubmit ¶
func (h *Handlers) EventsBatchSubmit(ctx context.Context, req *externalapi.RecordEventsBatchInput) (externalapi.EventsBatchSubmitRes, error)
EventsBatchSubmit records each Event independently and reports a per-item result.
func (*Handlers) EventsCreate ¶
func (h *Handlers) EventsCreate(ctx context.Context, req *externalapi.RecordEventsInput) (externalapi.EventsCreateRes, error)
func (*Handlers) ExportAudit ¶
func (h *Handlers) ExportAudit(ctx context.Context, params externalapi.ExportAuditParams) (externalapi.ExportAuditRes, error)
ExportAudit serves the Audit stream (ADR 0045): the Audit entries oldest first as NDJSON. It needs the `audit` license feature as well as `export`; without it the operation is absent (404), like the Audit log read is without its license.
func (*Handlers) ExportContacts ¶
func (h *Handlers) ExportContacts(ctx context.Context, params externalapi.ExportContactsParams) (externalapi.ExportContactsRes, error)
ExportContacts serves the Contacts stream (ADR 0045), the same shape as ExportEvents.
func (*Handlers) ExportErasures ¶
func (h *Handlers) ExportErasures(ctx context.Context, params externalapi.ExportErasuresParams) (externalapi.ExportErasuresRes, error)
ExportErasures serves the Erasures stream (ADR 0045): NDJSON rows, the next cursor in the X-Next-Cursor header, behind the same gate as every Export stream.
func (*Handlers) ExportEvents ¶
func (h *Handlers) ExportEvents(ctx context.Context, params externalapi.ExportEventsParams) (externalapi.ExportEventsRes, error)
ExportEvents serves the Events stream (ADR 0045): NDJSON rows, the next cursor in the X-Next-Cursor header. A stream added later is this handler with its own typed responses and its own exportstream page function.
func (*Handlers) ExportMessages ¶
func (h *Handlers) ExportMessages(ctx context.Context, params externalapi.ExportMessagesParams) (externalapi.ExportMessagesRes, error)
ExportMessages serves the Outbound messages stream (ADR 0045): the same NDJSON page, cursor header and gates as the Events stream, over delivery metadata only.
func (*Handlers) IntegrationsArchive ¶
func (h *Handlers) IntegrationsArchive(ctx context.Context, params externalapi.IntegrationsArchiveParams) (externalapi.IntegrationsArchiveRes, error)
IntegrationsArchive archives an Integration (ADR 0049): it leaves the list and gives up the default, unless live work uses it (409).
func (*Handlers) IntegrationsCreate ¶
func (h *Handlers) IntegrationsCreate(ctx context.Context, req *externalapi.CreateIntegrationInput) (externalapi.IntegrationsCreateRes, error)
IntegrationsCreate stores a new Integration; credentials are sealed and never returned.
func (*Handlers) IntegrationsGet ¶
func (h *Handlers) IntegrationsGet(ctx context.Context, params externalapi.IntegrationsGetParams) (externalapi.IntegrationsGetRes, error)
IntegrationsGet returns one Integration with secrets redacted.
func (*Handlers) IntegrationsList ¶
func (h *Handlers) IntegrationsList(ctx context.Context, params externalapi.IntegrationsListParams) (externalapi.IntegrationsListRes, error)
IntegrationsList returns the Workspace's sending-provider Integrations with the Send rate limit as enforced and the last 24 hours of usage.
func (*Handlers) IntegrationsRegenerateKey ¶
func (h *Handlers) IntegrationsRegenerateKey(ctx context.Context, params externalapi.IntegrationsRegenerateKeyParams) (externalapi.IntegrationsRegenerateKeyRes, error)
IntegrationsRegenerateKey gives the Integration a new hook key: the old hook URL stops working at once. Hidden from MCP, because it breaks a working URL and needs a person.
func (*Handlers) IntegrationsUnarchive ¶
func (h *Handlers) IntegrationsUnarchive(ctx context.Context, params externalapi.IntegrationsUnarchiveParams) (externalapi.IntegrationsUnarchiveRes, error)
IntegrationsUnarchive restores an archived Integration to the list. It is not the default.
func (*Handlers) IntegrationsUpdate ¶
func (h *Handlers) IntegrationsUpdate(ctx context.Context, req *externalapi.UpdateIntegrationInput, params externalapi.IntegrationsUpdateParams) (externalapi.IntegrationsUpdateRes, error)
IntegrationsUpdate edits an Integration. Omitting config keeps the stored credentials; blank secret fields inside a supplied config keep the stored secret.
func (*Handlers) PresetsList ¶
func (h *Handlers) PresetsList(ctx context.Context) (externalapi.PresetsListRes, error)
PresetsList returns the Presets the Instance offers with the params schema of each: how an agent learns what an Integration's `params` takes.
func (*Handlers) RuleFiringsList ¶
func (h *Handlers) RuleFiringsList(ctx context.Context, params externalapi.RuleFiringsListParams) (externalapi.RuleFiringsListRes, error)
RuleFiringsList lists a Rule's Firings, newest first.
func (*Handlers) RulesActivate ¶
func (h *Handlers) RulesActivate(ctx context.Context, params externalapi.RulesActivateParams) (externalapi.RulesActivateRes, error)
RulesActivate and RulesDeactivate need automations:activate, which authoring scopes never imply (ADR 0016). Over MCP, activate additionally needs mcp:send (the x-mcp send flag).
func (*Handlers) RulesArchive ¶
func (h *Handlers) RulesArchive(ctx context.Context, params externalapi.RulesArchiveParams) (externalapi.RulesArchiveRes, error)
RulesArchive archives a Rule (ADR 0049): it acts on nothing and keeps its Firings.
func (*Handlers) RulesCreate ¶
func (h *Handlers) RulesCreate(ctx context.Context, req *externalapi.CreateRuleInput) (externalapi.RulesCreateRes, error)
RulesCreate always stores a draft: activating is the send-class operation.
func (*Handlers) RulesDeactivate ¶
func (h *Handlers) RulesDeactivate(ctx context.Context, params externalapi.RulesDeactivateParams) (externalapi.RulesDeactivateRes, error)
func (*Handlers) RulesDelete ¶
func (h *Handlers) RulesDelete(ctx context.Context, params externalapi.RulesDeleteParams) (externalapi.RulesDeleteRes, error)
RulesDelete purges a Rule that has no Firings; one with Firings is archived instead (409).
func (*Handlers) RulesDryRun ¶
func (h *Handlers) RulesDryRun(ctx context.Context, req *externalapi.DryRunRuleInput, params externalapi.RulesDryRunParams) (externalapi.RulesDryRunRes, error)
RulesDryRun reports what a stored Event would do to the Rule. It writes and runs nothing, so reading scope is enough.
func (*Handlers) RulesGet ¶
func (h *Handlers) RulesGet(ctx context.Context, params externalapi.RulesGetParams) (externalapi.RulesGetRes, error)
func (*Handlers) RulesList ¶
func (h *Handlers) RulesList(ctx context.Context, params externalapi.RulesListParams) (externalapi.RulesListRes, error)
func (*Handlers) RulesUnarchive ¶
func (h *Handlers) RulesUnarchive(ctx context.Context, params externalapi.RulesUnarchiveParams) (externalapi.RulesUnarchiveRes, error)
RulesUnarchive restores an archived Rule, as a draft.
func (*Handlers) RulesUpdate ¶
func (h *Handlers) RulesUpdate(ctx context.Context, req *externalapi.UpdateRuleInput, params externalapi.RulesUpdateParams) (externalapi.RulesUpdateRes, error)
func (*Handlers) SegmentsArchive ¶
func (h *Handlers) SegmentsArchive(ctx context.Context, params externalapi.SegmentsArchiveParams) (externalapi.SegmentsArchiveRes, error)
SegmentsArchive archives a segment (ADR 0049); a draft or scheduled Broadcast refuses it with 409.
func (*Handlers) SegmentsCreate ¶
func (h *Handlers) SegmentsCreate(ctx context.Context, req *externalapi.CreateSegmentInput) (externalapi.SegmentsCreateRes, error)
func (*Handlers) SegmentsGet ¶
func (h *Handlers) SegmentsGet(ctx context.Context, params externalapi.SegmentsGetParams) (externalapi.SegmentsGetRes, error)
func (*Handlers) SegmentsList ¶
func (h *Handlers) SegmentsList(ctx context.Context, params externalapi.SegmentsListParams) (externalapi.SegmentsListRes, error)
func (*Handlers) SegmentsPreview ¶
func (h *Handlers) SegmentsPreview(ctx context.Context, req *externalapi.PreviewSegmentInput) (externalapi.SegmentsPreviewRes, error)
func (*Handlers) SegmentsUnarchive ¶
func (h *Handlers) SegmentsUnarchive(ctx context.Context, params externalapi.SegmentsUnarchiveParams) (externalapi.SegmentsUnarchiveRes, error)
SegmentsUnarchive restores an archived segment to the list.
func (*Handlers) SegmentsUpdate ¶
func (h *Handlers) SegmentsUpdate(ctx context.Context, req *externalapi.UpdateSegmentInput, params externalapi.SegmentsUpdateParams) (externalapi.SegmentsUpdateRes, error)
func (*Handlers) SendingDomainRatesList ¶
func (h *Handlers) SendingDomainRatesList(ctx context.Context, params externalapi.SendingDomainRatesListParams) (externalapi.SendingDomainRatesListRes, error)
SendingDomainRatesList returns the (numerator, denominator, rate) triples of ADR 0011 for every Sending domain, over the trailing window.
func (*Handlers) SendingDomainsArchive ¶
func (h *Handlers) SendingDomainsArchive(ctx context.Context, params externalapi.SendingDomainsArchiveParams) (externalapi.SendingDomainsArchiveRes, error)
SendingDomainsArchive archives a Sending domain (ADR 0049): it leaves the list and serves no Tracking domain host. Live sends from it refuse it with 409.
func (*Handlers) SendingDomainsCreate ¶
func (h *Handlers) SendingDomainsCreate(ctx context.Context, req *externalapi.CreateSendingDomainInput) (externalapi.SendingDomainsCreateRes, error)
SendingDomainsCreate adds a Sending domain; the DKIM keypair is minted and sealed.
func (*Handlers) SendingDomainsGet ¶
func (h *Handlers) SendingDomainsGet(ctx context.Context, params externalapi.SendingDomainsGetParams) (externalapi.SendingDomainsGetRes, error)
SendingDomainsGet returns one Sending domain.
func (*Handlers) SendingDomainsList ¶
func (h *Handlers) SendingDomainsList(ctx context.Context, params externalapi.SendingDomainsListParams) (externalapi.SendingDomainsListRes, error)
SendingDomainsList returns the Workspace's Sending domains with the DNS records to publish.
func (*Handlers) SendingDomainsUnarchive ¶
func (h *Handlers) SendingDomainsUnarchive(ctx context.Context, params externalapi.SendingDomainsUnarchiveParams) (externalapi.SendingDomainsUnarchiveRes, error)
SendingDomainsUnarchive restores an archived Sending domain and starts a DNS check.
func (*Handlers) SendingDomainsUpdate ¶
func (h *Handlers) SendingDomainsUpdate(ctx context.Context, req *externalapi.UpdateSendingDomainInput, params externalapi.SendingDomainsUpdateParams) (externalapi.SendingDomainsUpdateRes, error)
SendingDomainsUpdate changes the DKIM selector, which unverifies the domain.
func (*Handlers) SendingDomainsVerify ¶
func (h *Handlers) SendingDomainsVerify(ctx context.Context, params externalapi.SendingDomainsVerifyParams) (externalapi.SendingDomainsVerifyRes, error)
SendingDomainsVerify triggers the live DKIM check and returns the domain as it stands; the outcome shows on a later read (`verified`, `lastCheckedAt`).
func (*Handlers) SuppressionsCreate ¶
func (h *Handlers) SuppressionsCreate(ctx context.Context, req *externalapi.CreateSuppressionInput) (externalapi.SuppressionsCreateRes, error)
func (*Handlers) TagsApply ¶
func (h *Handlers) TagsApply(ctx context.Context, req *externalapi.ApplyTagInput, params externalapi.TagsApplyParams) (externalapi.TagsApplyRes, error)
func (*Handlers) TagsDelete ¶
func (h *Handlers) TagsDelete(ctx context.Context, params externalapi.TagsDeleteParams) (externalapi.TagsDeleteRes, error)
TagsDelete deletes a Tag from the catalogue unless a Segment rule or an Automation step names it (ADR 0049).
func (*Handlers) TagsList ¶
func (h *Handlers) TagsList(ctx context.Context, params externalapi.TagsListParams) (externalapi.TagsListRes, error)
func (*Handlers) TagsListForContact ¶
func (h *Handlers) TagsListForContact(ctx context.Context, params externalapi.TagsListForContactParams) (externalapi.TagsListForContactRes, error)
func (*Handlers) TagsRemove ¶
func (h *Handlers) TagsRemove(ctx context.Context, params externalapi.TagsRemoveParams) (externalapi.TagsRemoveRes, error)
func (*Handlers) TemplatesCreate ¶
func (h *Handlers) TemplatesCreate(ctx context.Context, req *externalapi.CreateTemplateInput) (externalapi.TemplatesCreateRes, error)
func (*Handlers) TemplatesDelete ¶
func (h *Handlers) TemplatesDelete(ctx context.Context, params externalapi.TemplatesDeleteParams) (externalapi.TemplatesDeleteRes, error)
func (*Handlers) TemplatesGet ¶
func (h *Handlers) TemplatesGet(ctx context.Context, params externalapi.TemplatesGetParams) (externalapi.TemplatesGetRes, error)
func (*Handlers) TemplatesList ¶
func (h *Handlers) TemplatesList(ctx context.Context, params externalapi.TemplatesListParams) (externalapi.TemplatesListRes, error)
func (*Handlers) TemplatesUpdate ¶
func (h *Handlers) TemplatesUpdate(ctx context.Context, req *externalapi.UpdateTemplateInput, params externalapi.TemplatesUpdateParams) (externalapi.TemplatesUpdateRes, error)
func (*Handlers) UnsubscribesCreate ¶
func (h *Handlers) UnsubscribesCreate(ctx context.Context, req *externalapi.CreateUnsubscribeInput) (externalapi.UnsubscribesCreateRes, error)
func (*Handlers) WebhooksCreate ¶
func (h *Handlers) WebhooksCreate(ctx context.Context, req *externalapi.CreateWebhookInput) (externalapi.WebhooksCreateRes, error)
func (*Handlers) WebhooksDelete ¶
func (h *Handlers) WebhooksDelete(ctx context.Context, params externalapi.WebhooksDeleteParams) (externalapi.WebhooksDeleteRes, error)
func (*Handlers) WebhooksGet ¶
func (h *Handlers) WebhooksGet(ctx context.Context, params externalapi.WebhooksGetParams) (externalapi.WebhooksGetRes, error)
func (*Handlers) WebhooksList ¶
func (h *Handlers) WebhooksList(ctx context.Context, params externalapi.WebhooksListParams) (externalapi.WebhooksListRes, error)
func (*Handlers) WebhooksRegenerateSecret ¶
func (h *Handlers) WebhooksRegenerateSecret(ctx context.Context, params externalapi.WebhooksRegenerateSecretParams) (externalapi.WebhooksRegenerateSecretRes, error)
WebhooksRegenerateSecret replaces the endpoint's signing secret. The new secret is not part of the response: the external API never returns it.
func (*Handlers) WebhooksTest ¶
func (h *Handlers) WebhooksTest(ctx context.Context, req *externalapi.TestWebhookInput, params externalapi.WebhooksTestParams) (externalapi.WebhooksTestRes, error)
WebhooksTest sends a sample event to the endpoint and returns what the receiver answered; the endpoint's failure state is not touched.
func (*Handlers) WebhooksUpdate ¶
func (h *Handlers) WebhooksUpdate(ctx context.Context, req *externalapi.UpdateWebhookInput, params externalapi.WebhooksUpdateParams) (externalapi.WebhooksUpdateRes, error)
Source Files
¶
- audit.go
- auth.go
- automations.go
- automations_http.go
- brand_kit.go
- broadcasts.go
- captured_messages.go
- consent.go
- contacts.go
- contacts_export.go
- email_lint.go
- email_schema.go
- emails.go
- enrollments.go
- events.go
- export_audit.go
- export_contacts.go
- export_erasures.go
- export_messages.go
- export_streams.go
- handlers.go
- integrations.go
- inuse.go
- reference.go
- rules.go
- segments.go
- sending_domains.go
- tags.go
- templates.go
- webhooks.go
- webhooks_actions.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package resources holds goverter-generated mappers from ent entities to external API resources, plus the custom conversions goverter cannot infer.
|
Package resources holds goverter-generated mappers from ent entities to external API resources, plus the custom conversions goverter cannot infer. |