Integrations
Package: github.com/emergent-company/emergent.memory/apps/server/pkg/sdk/integrations
Client field: client.Integrations
Integrations connect the Memory platform to third-party data sources (e.g. Confluence, Notion, GitHub). Once configured, you can trigger syncs to import content as documents and graph objects.
Methods
Section titled “Methods”ListAvailable
Section titled “ListAvailable”func (c *Client) ListAvailable(ctx context.Context) ([]AvailableIntegration, error)Returns all integration providers supported by this Memory deployment.
GET /api/integrations/available
func (c *Client) List(ctx context.Context) ([]Integration, error)Lists all configured integrations for the current project.
GET /api/integrations
func (c *Client) Get(ctx context.Context, name string) (*Integration, error)Returns a specific integration by name. Includes sensitive config fields.
GET /api/integrations/:name
GetPublic
Section titled “GetPublic”func (c *Client) GetPublic(ctx context.Context, name string) (*PublicIntegration, error)Returns the non-sensitive view of an integration (no credentials).
GET /api/integrations/:name/public
Create
Section titled “Create”func (c *Client) Create(ctx context.Context, req *CreateIntegrationRequest) (*Integration, error)Configures a new integration for the current project.
POST /api/integrations
Update
Section titled “Update”func (c *Client) Update(ctx context.Context, name string, req *UpdateIntegrationRequest) (*Integration, error)Replaces an integration’s configuration (full PUT).
PUT /api/integrations/:name
Delete
Section titled “Delete”func (c *Client) Delete(ctx context.Context, name string) errorRemoves an integration and its configuration.
DELETE /api/integrations/:name
TestConnection
Section titled “TestConnection”func (c *Client) TestConnection(ctx context.Context, name string) (*TestConnectionResponse, error)Tests whether the integration can reach its external service.
POST /api/integrations/:name/test
TriggerSync
Section titled “TriggerSync”func (c *Client) TriggerSync(ctx context.Context, name string, config *TriggerSyncConfig) (*TriggerSyncResponse, error)Triggers an immediate sync. config is optional — pass nil for defaults.
POST /api/integrations/:name/sync
AvailableIntegration
Section titled “AvailableIntegration”type AvailableIntegration struct { Name string `json:"name"` DisplayName string `json:"display_name"` Description string `json:"description"` Category string `json:"category"` AuthType string `json:"auth_type"` RequiredFields []string `json:"required_fields"` OptionalFields []string `json:"optional_fields,omitempty"` DocumentationURL string `json:"documentation_url,omitempty"`}Integration
Section titled “Integration”type Integration struct { ID string `json:"id"` Name string `json:"name"` DisplayName string `json:"display_name"` ProviderType string `json:"provider_type"` OrgID string `json:"org_id"` ProjectID string `json:"project_id"` Status string `json:"status"` Config any `json:"config,omitempty"` LastSyncAt *time.Time `json:"last_sync_at,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"`}Status values: "active", "inactive", "error".
PublicIntegration
Section titled “PublicIntegration”Non-sensitive fields only (omits Config):
type PublicIntegration struct { ID string `json:"id"` Name string `json:"name"` DisplayName string `json:"display_name"` ProviderType string `json:"provider_type"` Status string `json:"status"` LastSyncAt *time.Time `json:"last_sync_at,omitempty"` CreatedAt time.Time `json:"created_at"`}CreateIntegrationRequest
Section titled “CreateIntegrationRequest”type CreateIntegrationRequest struct { Name string `json:"name"` DisplayName string `json:"display_name"` ProviderType string `json:"provider_type"` Config any `json:"config"`}Config shape varies by ProviderType; consult ListAvailable().RequiredFields.
UpdateIntegrationRequest
Section titled “UpdateIntegrationRequest”type UpdateIntegrationRequest struct { DisplayName string `json:"display_name,omitempty"` Config any `json:"config,omitempty"` Status string `json:"status,omitempty"`}TriggerSyncConfig
Section titled “TriggerSyncConfig”type TriggerSyncConfig struct { FullSync *bool `json:"full_sync,omitempty"` SourceTypes []string `json:"source_types,omitempty"` SpaceIDs []string `json:"space_ids,omitempty"` IncludeArchived *bool `json:"includeArchived,omitempty"` BatchSize *int `json:"batchSize,omitempty"`}TestConnectionResponse / TriggerSyncResponse
Section titled “TestConnectionResponse / TriggerSyncResponse”type TestConnectionResponse struct { Success bool `json:"success"` Message string `json:"message"`}
type TriggerSyncResponse struct { Success bool `json:"success"` Message string `json:"message"` JobID *string `json:"job_id,omitempty"`}Example
Section titled “Example”// Create a Confluence integrationintegration, err := client.Integrations.Create(ctx, &integrations.CreateIntegrationRequest{ Name: "confluence-main", DisplayName: "Confluence (Main)", ProviderType: "confluence", Config: map[string]any{ "base_url": "https://myorg.atlassian.net", "api_token": os.Getenv("CONFLUENCE_TOKEN"), "email": "user@example.com", },})if err != nil { log.Fatal(err)}
// Test the connectiontest, _ := client.Integrations.TestConnection(ctx, integration.Name)fmt.Println("Connection OK:", test.Success)
// Trigger a full syncfullSync := truesyncResp, err := client.Integrations.TriggerSync(ctx, integration.Name, &integrations.TriggerSyncConfig{ FullSync: &fullSync,})fmt.Println("Sync job:", syncResp.JobID)