Skip to main content

API

Gety exposes a REST API for programmatic search. Use it to build custom integrations, connect AI agents, or call Gety from scripts.

Set up

  1. Open Gety → Settings → AI Integrations and click API under More Options

Gety AI Integrations page showing API under More Options Gety → Settings → AI Integrations: click API under More Options

  1. Enter a name for your integration and click Create

Add API Integration dialog with name field Give your integration a name — this helps you identify it later

  1. Gety generates your API documentation. You can browse the endpoints to find what you need, or click Copy All to copy the full documentation and hand it to your coding agent to start building.

API Documentation dialog showing base URL, API key, and endpoints Your API documentation — click Copy All to copy everything

Quick start

Search your files with a single request:

curl -X POST "http://127.0.0.1:31226/api/v1/search" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"query": "meeting notes", "limit": 10}'
Give it to an AI agent

Copy the full API documentation and paste it into your agent's conversation. Two ways to use it:

  • Direct use — tell the agent to call the API on your behalf: "This is my Gety search API. Use it whenever I ask you to search for files."
  • Build with it — let a coding agent integrate Gety into your application: "Here's the Gety API docs. Build a search feature that queries my local files."

Either way, the agent has everything it needs to get started.

Authentication

All requests require a Bearer token in the Authorization header:

Authorization: Bearer sk-gety-api-xxxxx

Each integration gets its own API key. You can create multiple integrations in Gety → Settings → AI Integrations.

Endpoints

Search documents

POST /api/v1/search

Search across all indexed files.

Request body:

ParameterTypeRequiredDefaultDescription
querystringyesSearch text. Use keyword-based queries for best results.
limitnumberno10Maximum number of results
semantic_searchbooleannotrueEnable semantic search for contextual understanding, or disable for exact keyword matching
connector_names_filterstring[]noallFilter by connector names (e.g. ["Folder: Documents"])
update_time_filterobjectnoFilter by time range. Use from and to fields in ISO 8601 format
sort_bystringno"default""default" (relevance) or "update_time"
sort_orderstringno"descending""ascending" or "descending"

Example:

curl -X POST "http://127.0.0.1:31226/api/v1/search" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "quarterly budget report",
"limit": 5,
"semantic_search": true
}'

Get document

GET /api/v1/connectors/{connector_id}/docs/{doc_id}

Retrieve the full content of a specific document. Use connector_id and doc_id from search results.

Example:

curl "http://127.0.0.1:31226/api/v1/connectors/CONNECTOR_ID/docs/DOC_ID" \
-H "Authorization: Bearer YOUR_API_KEY"

Download original file

GET /api/v1/connectors/{connector_id}/docs/{doc_id}/file

Download the raw file bytes for a document.

Example:

curl "http://127.0.0.1:31226/api/v1/connectors/CONNECTOR_ID/docs/DOC_ID/file" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o downloaded-file.pdf

List connectors

GET /api/v1/connectors

List all available connectors (indexed folders and data sources).

Example:

curl "http://127.0.0.1:31226/api/v1/connectors" \
-H "Authorization: Bearer YOUR_API_KEY"

Error codes

CodeMeaning
UNAUTHORIZEDInvalid or missing API key
REQUEST_VALIDATION_FAILEDInvalid request parameters
RESOURCE_NOT_FOUNDDocument or connector not found
QUOTA_EXCEEDEDFree tier limit reached
DATA_SHARING_DECLINEDUser declined the data sharing prompt
INTERNAL_ERRORServer error