# Endpoints

DataBridge's API is organized into several logical paths:

## [Ingest](/databridge-docs/api-reference/endpoints/ingest.md)

Endpoints for ingesting and managing documents:

* Text document ingestion
* File document ingestion
* Document metadata management

## [Search](/databridge-docs/api-reference/endpoints/search.md)

Endpoints for semantic search functionality:

* Document chunk search
* Document listing and retrieval
* Document metadata search

## [Query](/databridge-docs/api-reference/endpoints/query.md)

Endpoints for AI-powered query operations:

* AI completions with context
* RAG-based question answering
* Context-aware responses

## [Cache](/databridge-docs/api-reference/endpoints/cache.md)

*Coming soon*

## [Response Models](/databridge-docs/api-reference/endpoints/models.md)

Common data models used across the API:

* Document models
* Search result models
* Query response models

## Response Models

### Document

```python
class Document:
    external_id: str
    owner: Dict[str, str]
    content_type: str
    filename: Optional[str]
    metadata: Dict[str, Any]  # user-defined metadata
    storage_info: Dict[str, str]  # storage backend info
    system_metadata: Dict[str, Any]  # creation date, version, etc.
    additional_metadata: Dict[str, Any]  # e.g., frame descriptions and transcripts for videos
    access_control: Dict[str, List[str]]  # readers, writers, admins
    chunk_ids: List[str]
```

### ChunkResult

```python
class ChunkResult:
    content: str
    score: float
    document_id: str  # external_id
    chunk_number: int
    metadata: Dict[str, Any]
    content_type: str
    filename: Optional[str]
    download_url: Optional[str]

    def augmented_content(self, doc: DocumentResult) -> str:
        """Get augmented content for video chunks with frame/transcript info"""
```

### DocumentResult

```python
class DocumentResult:
    score: float  # Highest chunk score
    document_id: str  # external_id
    metadata: Dict[str, Any]
    content: DocumentContent  # type and value fields
    additional_metadata: Dict[str, Any]  # e.g., frame descriptions and transcripts
```

### DocumentContent

```python
class DocumentContent:
    type: Literal["url", "string"]  # Content type
    value: str  # URL or actual content
    filename: Optional[str]  # Required for URL type, None for string type
```

### CompletionResponse

```python
class CompletionResponse:
    completion: str
    usage: TokenUsage  # completion_tokens, prompt_tokens, total_tokens
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://databridge.gitbook.io/databridge-docs/api-reference/endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
