Go API reference
Package github.com/xberg-io/sdks/packages/go. Every method below is on the client.
Extraction
Section titled “Extraction”Submit documents and wait for results.
| Method | Description |
|---|---|
Extract |
Extract submits a single document for asynchronous extraction and returns the queued [JobResponse] |
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 [JobResponse] |
Poll, read, page through and cancel extraction jobs.
| Method | Description |
|---|---|
ListJobs |
ListJobs lists jobs via GET /v1/jobs (paginated) |
GetJob |
GetJob fetches the current status of a single job 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 |
Presets
Section titled “Presets”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}) |
Saved presets
Section titled “Saved presets”Project-scoped presets you create and update.
| Method | Description |
|---|---|
ListSavedPresets |
ListSavedPresets lists the caller’s saved presets (GET /v1/saved_presets on Enterprise, GET /v1/saved-presets on Pro, paginated) |
CreateSavedPreset |
CreateSavedPreset creates a saved preset (POST /v1/saved_presets on Enterprise, POST /v1/saved-presets on Pro) |
GetSavedPreset |
GetSavedPreset fetches one saved preset (GET /v1/saved_presets/{presetID} on Enterprise, GET /v1/saved-presets/{presetID} on Pro) |
UpdateSavedPreset |
UpdateSavedPreset updates a saved preset (PATCH /v1/saved_presets/{presetID} on Enterprise, PATCH /v1/saved-presets/{presetID} on Pro) |
DeleteSavedPreset |
DeleteSavedPreset deletes a saved preset (DELETE /v1/saved_presets/{presetID} on Enterprise, DELETE /v1/saved-presets/{presetID} on Pro) |
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) |
Auto-tune
Section titled “Auto-tune”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}) |
Tuning profiles
Section titled “Tuning profiles”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}) |
Documents and lineage
Section titled “Documents and lineage”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}) |
Enrich
Section titled “Enrich”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}) |
Uploads and usage
Section titled “Uploads and usage”Enterprise-only upload staging and metering.
| Method | Description |
|---|---|
PresignUpload |
PresignUpload requests a presigned upload URL (POST /v1/uploads/presign) |
ConfirmUpload |
ConfirmUpload confirms a presigned upload (POST /v1/uploads/confirm) |
Usage |
Usage fetches usage/metering data (GET /v1/usage) |
ListExtractionEvents |
ListExtractionEvents lists the project’s extraction events (GET /v1/extractions) |
Control plane
Section titled “Control plane”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}) |
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) |
Client accessors
Section titled “Client accessors”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 the control-plane surface will be addressed at once it exists — no request is routed there yet, see [WithControlPlaneBaseURL] |
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. |