Skip to content

Go API reference

Package github.com/xberg-io/sdks/packages/go. Every method below is on the client.

Submit documents and wait for results.

Method Description
Extract Extract submits a single document for asynchronous extraction and returns the queued [ExtractionJobResponse]
ExtractBatch ExtractBatch submits multiple documents in a single multipart request
ExtractAndWait ExtractAndWait is a convenience wrapper that submits a single document and blocks until extraction completes, returning the terminal [ExtractionJobResponse]

Poll, read, page through and cancel extraction jobs.

Method Description
ListJobs ListJobs lists jobs via GET /v1/jobs (paginated)
GetJob GetJob fetches a tagged extraction or crawl job record by ID
GetJobResult GetJobResult fetches a job’s stored extraction result via GET /v1/jobs/{id}/result
GetJobPage GetJobPage downloads one page raster persisted during a structured extraction (GET /v1/jobs/{jobID}/pages/{pageNumber})
CancelJob CancelJob cancels a running job (DELETE /v1/jobs/{id})
WaitForJob WaitForJob polls GET /v1/jobs/{id} until the job reaches a terminal status or the configured timeout elapses
WaitForJobs WaitForJobs concurrently waits for a slice of job IDs and returns their results in submission order
Audit Audit fetches audit-log entries via GET /v1/audit

Enterprise-only crawl job event stream.

Method Description
StreamCrawlEvents StreamCrawlEvents subscribes to a crawl job’s Server-Sent Events feed (GET /v1/crawl-jobs/{crawlJobID}/events) and returns an iterator over the events it publishes

The curated preset registry, served by both tiers.

Method Description
Presets Presets lists the curated, read-only managed presets (GET /v1/presets)
GetPreset GetPreset fetches the full detail of a managed preset (GET /v1/presets/{id})
GetPresetSample GetPresetSample downloads the raw bytes of a preset’s bundled sample file (GET /v1/presets/{id}/sample/{name})

Project-scoped presets you create and update.

Method Description
ListSavedPresets ListSavedPresets lists the caller’s saved presets (GET /v1/saved_presets, paginated)
CreateSavedPreset CreateSavedPreset creates a saved preset (POST /v1/saved_presets)
GetSavedPreset GetSavedPreset fetches one saved preset (GET /v1/saved_presets/{presetID})
UpdateSavedPreset UpdateSavedPreset updates a saved preset (PATCH /v1/saved_presets/{presetID})
DeleteSavedPreset DeleteSavedPreset deletes a saved preset (DELETE /v1/saved_presets/{presetID})

Collections, documents and retrieval.

Method Description
ListRagCollections ListRagCollections lists RAG collections (GET /v1/rag/collections).
CreateRagCollection CreateRagCollection creates a RAG collection (POST /v1/rag/collections).
GetRagCollection GetRagCollection fetches a RAG collection (GET /v1/rag/collections/{name}).
DeleteRagCollection DeleteRagCollection deletes a RAG collection (DELETE /v1/rag/collections/{name})
AddRagDocuments AddRagDocuments adds documents to a RAG collection (POST /v1/rag/collections/{name}/documents).
DeleteRagDocuments DeleteRagDocuments deletes documents from a RAG collection by ID or filter expression (DELETE /v1/rag/collections/{name}/documents)
ReindexRagDocument ReindexRagDocument reindexes a RAG document (POST /v1/rag/collections/{name}/documents/{id}/reindex).
RagRetrieve RagRetrieve retrieves chunks from a RAG collection (POST /v1/rag/collections/{name}/retrieve).
MigrateRagEmbeddings MigrateRagEmbeddings kicks off an embedding migration (POST /v1/rag/collections/{name}/migrate-embeddings).
GetRagMigrationJob GetRagMigrationJob polls an embedding-migration job (GET /v1/rag/collections/{name}/migrate-embeddings/{jobID}).
GetRagJob GetRagJob fetches a RAG job’s status (GET /v1/rag/jobs/{jobID}).
GetRagConfig GetRagConfig fetches a project’s RAG config (GET /v1/projects/{projectID}/rag-config)
SetRagConfig SetRagConfig updates a project’s RAG config (PUT /v1/projects/{projectID}/rag-config)

Tuning jobs and their results.

Method Description
SubmitAutoTune SubmitAutoTune starts an auto-tune run (POST /v1/auto-tune)
ListAutoTuneJobs ListAutoTuneJobs lists the project’s auto-tune jobs (GET /v1/auto-tune, paginated)
GetAutoTuneStatus GetAutoTuneStatus fetches an auto-tune job’s progress (GET /v1/auto-tune/{autoTuneJobID})
GetAutoTuneResult GetAutoTuneResult fetches a completed run’s leaderboard and winning profile (GET /v1/auto-tune/{autoTuneJobID}/result)
GetAutoTuneCapabilities GetAutoTuneCapabilities reports the OCR backends and tunable knobs this deployment can search over (GET /v1/auto-tune/capabilities)
PromoteAutoTuneProfile PromoteAutoTuneProfile promotes a completed run’s winning configuration into a named, reusable tuning profile (POST /v1/auto-tune/{autoTuneJobID}/promote)
DeleteAutoTuneJob DeleteAutoTuneJob cancels and deletes an auto-tune job (DELETE /v1/auto-tune/{autoTuneJobID})

Profiles promoted from auto-tune runs.

Method Description
ListTuningProfiles ListTuningProfiles lists the project’s promoted tuning profiles (GET /v1/tuning-profiles, paginated)
GetTuningProfile GetTuningProfile fetches one promoted tuning profile (GET /v1/tuning-profiles/{profileID})
DeleteTuningProfile DeleteTuningProfile deletes a promoted tuning profile (DELETE /v1/tuning-profiles/{profileID})

Enterprise-only document history.

Method Description
GetDocument GetDocument fetches a document’s latest version together with its extraction result (GET /v1/documents/{documentID})
Versions Versions lists a document’s versions (GET /v1/documents/{id}/versions)
Diff Diff diffs document versions (GET /v1/documents/{id}/diff)
GetDiffJob GetDiffJob polls a diff job (GET /v1/documents/{id}/diff/{diffJobID})

Enterprise-only text enrichment.

Method Description
SubmitEnrich SubmitEnrich submits text for asynchronous enrichment (POST /v1/enrich) and returns the queued job’s ID
GetEnrichStatus GetEnrichStatus polls an enrichment job (GET /v1/enrich/{jobID})

Enterprise-only upload staging and metering.

Method Description
PresignUpload PresignUpload requests presigned upload URLs (POST /v1/uploads/presign) and returns the decoded body, which carries a batch ID and one entry per object
ConfirmUpload ConfirmUpload confirms a presigned upload batch and enqueues extraction (POST /v1/uploads/confirm, 202)
Usage Usage fetches aggregate extraction usage for a date range (GET /v1/usage)
ListExtractionEvents ListExtractionEvents lists the project’s extraction events (GET /v1/extractions)

Pro-only projects, keys and integrations.

Method Description
ListProjects ListProjects lists the projects visible to the caller (GET /v1/projects, paginated)
CreateProject CreateProject creates a project (POST /v1/projects)
ListAPIKeys ListAPIKeys lists a project’s API keys (GET /v1/projects/{projectID}/api-keys, paginated)
CreateAPIKey CreateAPIKey issues a new API key for a project (POST /v1/projects/{projectID}/api-keys)
RevokeAPIKey RevokeAPIKey revokes an API key (DELETE /v1/projects/{projectID}/api-keys/{keyID})
ListIntegrations ListIntegrations lists a project’s integrations (GET /v1/projects/{projectID}/integrations, paginated)
CreateIntegration CreateIntegration registers an integration on a project (POST /v1/projects/{projectID}/integrations)
GetIntegration GetIntegration fetches one integration (GET /v1/projects/{projectID}/integrations/{integrationID})
DeleteIntegration DeleteIntegration removes an integration (DELETE /v1/projects/{projectID}/integrations/{integrationID})
ConnectIntegration ConnectIntegration begins the OAuth connection flow for an integration (POST /v1/projects/{projectID}/integrations/{integrationID}/connect) and returns the provider authorization URL the end user must visit
DisconnectIntegration DisconnectIntegration revokes an integration’s stored OAuth credentials (POST /v1/projects/{projectID}/integrations/{integrationID}/disconnect)
ListIntegrationDocuments ListIntegrationDocuments lists the documents a connected integration exposes (GET /v1/projects/{projectID}/integrations/{integrationID}/documents)
FetchIntegrationDocument FetchIntegrationDocument downloads one document’s bytes from a connected integration (GET /v1/projects/{projectID}/integrations/{integrationID}/documents/{documentID})

All backend operations use the configured control-plane origin and credential.

Method Description
DeleteAccount DeleteAccount calls DELETE /auth/account on the Enterprise control plane.
GetAuthConfig GetAuthConfig calls GET /auth/config on the Enterprise control plane.
GetUserProfile GetUserProfile calls GET /auth/profile on the Enterprise control plane
UpdateUserProfile UpdateUserProfile calls PATCH /auth/profile on the Enterprise control plane
BackendLogin BackendLogin calls POST /auth/login on the Enterprise control plane.
Healthz Healthz calls GET /healthz on the Enterprise control plane.
Readyz Readyz calls GET /readyz on the Enterprise control plane.
AcceptInvitation AcceptInvitation calls POST /v1/invitations/accept on the Enterprise control plane.
OAuthCallback OAuthCallback exchanges an OAuth code and returns the redirect location without following it
BackendListProjects BackendListProjects calls GET /v1/projects on the Enterprise control plane.
BackendCreateProject BackendCreateProject calls POST /v1/projects on the Enterprise control plane.
GetProject GetProject calls GET /v1/projects/{id} on the Enterprise control plane.
DeleteProject DeleteProject calls DELETE /v1/projects/{id} on the Enterprise control plane.
UpdateProject UpdateProject calls PATCH /v1/projects/{id} on the Enterprise control plane.
GetAnalytics GetAnalytics calls GET /v1/projects/{id}/analytics on the Enterprise control plane.
BackendListAPIKeys BackendListAPIKeys calls GET /v1/projects/{id}/api-keys on the Enterprise control plane.
BackendCreateAPIKey BackendCreateAPIKey calls POST /v1/projects/{id}/api-keys on the Enterprise control plane.
BackendRevokeAPIKey BackendRevokeAPIKey calls DELETE /v1/projects/{id}/api-keys/{key_id} on the Enterprise control plane.
RegenerateAPIKey RegenerateAPIKey calls POST /v1/projects/{id}/api-keys/{key_id}/regenerate on the Enterprise control plane.
ListProjectAudit ListProjectAudit calls GET /v1/projects/{id}/audit on the Enterprise control plane.
GetBilling GetBilling calls GET /v1/projects/{id}/billing on the Enterprise control plane.
CreateCheckout CreateCheckout calls POST /v1/projects/{id}/billing/checkout on the Enterprise control plane.
CreatePortal CreatePortal calls POST /v1/projects/{id}/billing/portal on the Enterprise control plane.
BackendListIntegrations BackendListIntegrations calls GET /v1/projects/{id}/integrations on the Enterprise control plane.
BackendCreateIntegration BackendCreateIntegration calls POST /v1/projects/{id}/integrations on the Enterprise control plane.
BackendGetIntegration BackendGetIntegration calls GET /v1/projects/{id}/integrations/{iid} on the Enterprise control plane.
BackendDeleteIntegration BackendDeleteIntegration calls DELETE /v1/projects/{id}/integrations/{iid} on the Enterprise control plane.
OAuthConnect OAuthConnect calls POST /v1/projects/{id}/integrations/{iid}/connect on the Enterprise control plane.
BackendDisconnectIntegration BackendDisconnectIntegration calls POST /v1/projects/{id}/integrations/{iid}/disconnect on the Enterprise control plane.
BackendListIntegrationDocuments BackendListIntegrationDocuments calls GET /v1/projects/{id}/integrations/{iid}/documents on the Enterprise control plane.
BackendFetchIntegrationDocument BackendFetchIntegrationDocument downloads original document bytes from the Enterprise control plane.
BackendGetIntegrationSync BackendGetIntegrationSync calls GET /v1/projects/{id}/integrations/{iid}/sync on the Enterprise control plane.
BackendSetIntegrationSync BackendSetIntegrationSync calls PUT /v1/projects/{id}/integrations/{iid}/sync on the Enterprise control plane.
ListInvitations ListInvitations calls GET /v1/projects/{id}/invitations on the Enterprise control plane.
InviteUser InviteUser calls POST /v1/projects/{id}/invitations on the Enterprise control plane.
RevokeInvitation RevokeInvitation calls DELETE /v1/projects/{id}/invitations/{inv_id} on the Enterprise control plane.
LeaveProject LeaveProject calls POST /v1/projects/{id}/leave on the Enterprise control plane.
ListMembers ListMembers calls GET /v1/projects/{id}/members on the Enterprise control plane.
RemoveMember RemoveMember calls DELETE /v1/projects/{id}/members/{user_id} on the Enterprise control plane.
UpdateMemberRole UpdateMemberRole calls PATCH /v1/projects/{id}/members/{user_id} on the Enterprise control plane.
AssignProjectRole AssignProjectRole calls PATCH /v1/projects/{id}/members/{user_id}/custom-role on the Enterprise control plane.
BackendGetRAGConfig BackendGetRAGConfig calls GET /v1/projects/{id}/rag-config on the Enterprise control plane.
BackendSetRAGConfig BackendSetRAGConfig calls PUT /v1/projects/{id}/rag-config on the Enterprise control plane.
ListProjectRoles ListProjectRoles calls GET /v1/projects/{id}/roles on the Enterprise control plane.
CreateProjectRole CreateProjectRole calls POST /v1/projects/{id}/roles on the Enterprise control plane.
GetProjectRole GetProjectRole calls GET /v1/projects/{id}/roles/{role_id} on the Enterprise control plane.
UpdateProjectRole UpdateProjectRole calls PATCH /v1/projects/{id}/roles/{role_id} on the Enterprise control plane.
DeleteProjectRole DeleteProjectRole calls DELETE /v1/projects/{id}/roles/{role_id} on the Enterprise control plane.
ListSamlDomains ListSamlDomains calls GET /v1/projects/{project_id}/saml/domains on the Enterprise control plane.
CreateSamlDomain CreateSamlDomain calls POST /v1/projects/{project_id}/saml/domains on the Enterprise control plane.
VerifySamlDomain VerifySamlDomain calls POST /v1/projects/{project_id}/saml/domains/{domain}/verify on the Enterprise control plane.
ListSamlProviders ListSamlProviders calls GET /v1/projects/{project_id}/saml/providers on the Enterprise control plane.
CreateSamlProvider CreateSamlProvider calls POST /v1/projects/{project_id}/saml/providers on the Enterprise control plane.
UpdateSamlProvider UpdateSamlProvider calls PUT /v1/projects/{project_id}/saml/providers/{provider_id} on the Enterprise control plane.
DeleteSamlProvider DeleteSamlProvider calls DELETE /v1/projects/{project_id}/saml/providers/{provider_id} on the Enterprise control plane.
SandboxExtract SandboxExtract extracts a single file using a project’s Enterprise sandbox.
ListScimConnections ListScimConnections calls GET /v1/projects/{id}/scim/connections on the Enterprise control plane.
CreateScimConnection CreateScimConnection calls POST /v1/projects/{id}/scim/connections on the Enterprise control plane.
ListScimAdminGroups ListScimAdminGroups calls GET /v1/projects/{id}/scim/connections/{connection_id}/groups on the Enterprise control plane.
ReplaceScimGroupRoles ReplaceScimGroupRoles calls PUT /v1/projects/{id}/scim/connections/{connection_id}/groups/{group_id}/roles on the Enterprise control plane.
RotateScimConnectionSecret RotateScimConnectionSecret calls POST /v1/projects/{id}/scim/connections/{connection_id}/rotate on the Enterprise control plane.
GetUsage GetUsage calls GET /v1/projects/{id}/usage on the Enterprise control plane.
ListWebhooks ListWebhooks calls GET /v1/projects/{id}/webhooks on the Enterprise control plane.
CreateWebhook CreateWebhook calls POST /v1/projects/{id}/webhooks on the Enterprise control plane.
DeleteWebhook DeleteWebhook calls DELETE /v1/projects/{id}/webhooks/{wh_id} on the Enterprise control plane.
UpdateWebhook UpdateWebhook calls PATCH /v1/projects/{id}/webhooks/{wh_id} on the Enterprise control plane.
ListWebhookDeliveries ListWebhookDeliveries calls GET /v1/projects/{id}/webhooks/{wh_id}/deliveries on the Enterprise control plane.
RetryWebhookDelivery RetryWebhookDelivery calls POST /v1/projects/{id}/webhooks/{wh_id}/deliveries/{delivery_id}/retry on the Enterprise control plane.
TestWebhook TestWebhook calls POST /v1/projects/{id}/webhooks/{wh_id}/test on the Enterprise control plane.
PublicSandboxExtract PublicSandboxExtract submits a file, or a URL in web mode, to the Enterprise public sandbox

Pro liveness and coarse license/capability state.

Method Description
ProHealthz ProHealthz returns Pro liveness and coarse license/capability state, not dependency readiness

Pro-only session and configuration reads.

Method Description
AuthConfig AuthConfig fetches the instance’s accepted auth methods (GET /auth/config)
Login Login exchanges a verified OIDC ID token for a Pro session JWT (POST /auth/login)

Read back what the client was configured with. Go only; the other two expose these as properties.

Method Description
BaseURL BaseURL returns the configured base URL.
ControlPlaneBaseURL ControlPlaneBaseURL returns the origin of Enterprise control-plane requests
HTTPClient HTTPClient returns the underlying *http.Client
Target Target returns the explicitly configured target, or the empty [Target] when the tier is discovered lazily from GET /healthz.
Method Description
GetIntegrationSync GetIntegrationSync reads durable synchronization state
GetLicenseInfo GetLicenseInfo reports the instance’s license state (GET /v1/license): licensee, license ID, plan, expiry, grace window and days remaining
GetSubscriptionDelivery GetSubscriptionDelivery fetches one delivery attempt with its bounded request and response previews (GET /v1/webhooks/{webhookID}/deliveries/{deliveryID})
GetWebhookDelivery GetWebhookDelivery calls GET /v1/projects/{id}/webhooks/{wh_id}/deliveries/{delivery_id} on the Enterprise control plane.
ListManagedEmbeddingPresets ListManagedEmbeddingPresets lists the curated embedding presets a RAG collection may name (GET /v1/rag/embedding-presets)
ListSubscriptionDeliveries ListSubscriptionDeliveries lists a webhook subscription’s delivery attempts (GET /v1/webhooks/{webhookID}/deliveries, paginated)
PutLocalUpload PutLocalUpload writes raw document bytes against a presigned capability (PUT /v1/uploads/local/{projectID}/{token}, 204)
SetIntegrationSync SetIntegrationSync enables or disables durable synchronization
StopAutoTuneJob StopAutoTuneJob stops a running auto-tune job, keeping its artifacts (POST /v1/auto-tune/{autoTuneJobID}/stop)