> For the complete documentation index, see [llms.txt](https://docs.tagshelf.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tagshelf.dev/master.md). Agents can also search and read this documentation through its [MCP server](https://docs.tagshelf.dev/~gitbook/mcp).

# Alfred API

Send documents to Alfred, follow their processing and read the structured data it extracts.

{% columns %}
{% column width="50%" valign="middle" %}
Alfred turns documents into structured data. It classifies each file you send into a document type, extracts the data points you defined for that type, and returns the results through this API or as events sent to your server.

<a href="https://docs.tagshelf.dev/quick-start.md" class="button primary">Quick start</a> <a href="https://docs.tagshelf.dev/endpoints/api-conventions.md" class="button secondary">API conventions</a>
{% endcolumn %}

{% column width="50%" valign="middle" %}

<figure><img src="https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2F1grsY8nM5WTiYqq9y5EK%2Falfred-serving-documents.png?alt=media&amp;token=42889624-9ff6-43bd-aa1c-31049414622e" alt="Alfred carrying documents and structured data on a tray"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### Get started

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Quick start</strong></td><td>Send your first document and read its extracted data in four steps.</td><td><a href="https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2FWeSOvG2qwp25EiRzYB3w%2Fquick-start-paper-plane.png?alt=media&amp;token=90a166e3-4dff-459b-9761-158c771c878c">quick-start-paper-plane.png</a></td><td><a href="https://docs.tagshelf.dev/quick-start.md">Quick start</a></td></tr><tr><td><strong>Document processing</strong></td><td>How a file becomes a job, gets classified and has its data extracted.</td><td><a href="https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2FTI9crcxXU0ALCK4jmqW3%2Fdocument-processing-sorter.png?alt=media&amp;token=d17083f0-ddb0-4506-997d-78bc75e6fa28">document-processing-sorter.png</a></td><td><a href="https://docs.tagshelf.dev/document-processing.md">Document processing</a></td></tr><tr><td><strong>Webhooks</strong></td><td>Have Alfred notify your server when a job or a file changes, with the Event API.</td><td><a href="https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2FWNmnGVZYtQsj88y3cGvD%2Fwebhooks-service-bell.png?alt=media&amp;token=7c3a6301-c770-4183-9470-fb5a73a01131">webhooks-service-bell.png</a></td><td><a href="https://docs.tagshelf.dev/event-api.md">Event API</a></td></tr></tbody></table>

{% hint style="warning" %}
**Reading jobs changed in v1.130.0.** `GET /api/job/detail/{id}` now returns a short summary unless you ask for `view=full`, and `GET /api/job/all` returns a new page format. If your integration reads a job's files or metadata, see [Job](https://docs.tagshelf.dev/endpoints/job.md) for what to change.
{% endhint %}

### API reference

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-key" style="color:$primary;">:key:</i> <strong>Authentication</strong></td><td>API keys, OAuth tokens and HMAC signatures.</td><td><a href="https://docs.tagshelf.dev/authentication.md">Authentication</a></td></tr><tr><td><i class="fa-sliders" style="color:$primary;">:sliders:</i> <strong>API conventions</strong></td><td>Headers, response format, paging, errors and rate limits for every endpoint.</td><td><a href="https://docs.tagshelf.dev/endpoints/api-conventions.md">API conventions</a></td></tr><tr><td><i class="fa-file-arrow-up" style="color:$primary;">:file-arrow-up:</i> <strong>File</strong></td><td>Send documents by URL or by upload, follow their progress and read the results.</td><td><a href="https://docs.tagshelf.dev/endpoints/file.md">File</a></td></tr><tr><td><i class="fa-layer-group" style="color:$primary;">:layer-group:</i> <strong>Deferred Session</strong></td><td>Upload files one at a time and process them together as one job.</td><td><a href="https://docs.tagshelf.dev/endpoints/deferred-session.md">Deferred Session</a></td></tr><tr><td><i class="fa-cloud-arrow-down" style="color:$primary;">:cloud-arrow-down:</i> <strong>Remote Sources</strong></td><td>Let Alfred read files from your own cloud storage.</td><td><a href="https://docs.tagshelf.dev/endpoints/file/source.md">Remote Sources</a></td></tr><tr><td><i class="fa-list-check" style="color:$primary;">:list-check:</i> <strong>Job</strong></td><td>List your jobs, follow a job's stage, and cancel or restart it.</td><td><a href="https://docs.tagshelf.dev/endpoints/job.md">Job</a></td></tr><tr><td><i class="fa-database" style="color:$primary;">:database:</i> <strong>Values</strong></td><td>Read the data Alfred extracted from a file.</td><td><a href="https://docs.tagshelf.dev/endpoints/values.md">Values</a></td></tr><tr><td><i class="fa-magnifying-glass" style="color:$primary;">:magnifying-glass:</i> <strong>Search</strong></td><td>Find documents by their content and their extracted data.</td><td><a href="https://docs.tagshelf.dev/endpoints/search.md">Search</a></td></tr><tr><td><i class="fa-file-export" style="color:$primary;">:file-export:</i> <strong>Report</strong></td><td>Export the confirmed values of every file with a given tag.</td><td><a href="https://docs.tagshelf.dev/endpoints/report.md">Report</a></td></tr><tr><td><i class="fa-tag" style="color:$primary;">:tag:</i> <strong>Tag</strong></td><td>List, create and update your document types.</td><td><a href="https://docs.tagshelf.dev/endpoints/tag.md">Tag</a></td></tr><tr><td><i class="fa-table-list" style="color:$primary;">:table-list:</i> <strong>Metadata</strong></td><td>The data points each tag extracts, with their keys and types.</td><td><a href="https://docs.tagshelf.dev/endpoints/metadata.md">Metadata</a></td></tr><tr><td><i class="fa-bell" style="color:$primary;">:bell:</i> <strong>Event API</strong></td><td>The webhook events Alfred sends, with the payload of each one.</td><td><a href="https://docs.tagshelf.dev/event-api.md">Event API</a></td></tr><tr><td><i class="fa-circle-user" style="color:$primary;">:circle-user:</i> <strong>Account</strong></td><td>See the companies and tags you can use, and register your webhook.</td><td><a href="https://docs.tagshelf.dev/endpoints/account.md">Account</a></td></tr><tr><td><i class="fa-building" style="color:$primary;">:building:</i> <strong>Company</strong></td><td>Read your company's settings, including its job metadata templates.</td><td><a href="https://docs.tagshelf.dev/endpoints/company.md">Company</a></td></tr><tr><td><i class="fa-heart-pulse" style="color:$primary;">:heart-pulse:</i> <strong>Alfred</strong></td><td>Check that the API is available and that your credentials work.</td><td><a href="https://docs.tagshelf.dev/endpoints/tagshelf.md">Alfred</a></td></tr></tbody></table>

Two reference lists are worth keeping open while you build: [Job Stages](https://docs.tagshelf.dev/endpoints/job/job-stages.md) and [File Status](https://docs.tagshelf.dev/endpoints/file/file-status.md).

### Base URL

All requests go to one host:

```
https://app.tagshelf.com
```

The reference pages list each route as a path relative to this host. For example, `GET /api/tags` means `https://app.tagshelf.com/api/tags`, and `POST /token` means `https://app.tagshelf.com/token`.

Every request needs your credentials and a `User-Agent` header. See [API conventions](https://docs.tagshelf.dev/endpoints/api-conventions.md) before your first call.

{% hint style="info" %}
**Upcoming change to the API host.** A dedicated API domain, `https://api.tagshelf.com`, is being introduced. Once it is available we recommend migrating your integrations to it. API access over the `app.tagshelf.com` domain will then be deprecated and eventually disabled. We will announce the cutover timeline well in advance so you have time to migrate.
{% endhint %}

### SDKs and tools

Install the SDK for your language:

{% tabs %}
{% tab title="Python" %}

```bash
pip install alfred-python
```

[alfred-python on GitHub](https://github.com/tagshelfsrl/alfred-python)
{% endtab %}

{% tab title="Node.js and TypeScript" %}

```bash
npm install @tagshelf/alfred
```

[alfred-node on GitHub](https://github.com/tagshelfsrl/alfred-node)
{% endtab %}

{% tab title=".NET" %}

```bash
dotnet add package TagShelf.Alfred.ApiWrapper
```

[TagShelf.Alfred.ApiWrapper on NuGet](https://www.nuget.org/packages/TagShelf.Alfred.ApiWrapper/) · [dotnet-alfred-api-wrapper on GitHub](https://github.com/tagshelfsrl/dotnet-alfred-api-wrapper)
{% endtab %}
{% endtabs %}

Each SDK also includes a real-time client that receives job and file events over a persistent connection, without a webhook. See the README of the SDK you use.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-flask" style="color:$primary;">:flask:</i> <strong>Postman collection</strong></td><td>Example requests, with a pre-request script that signs HMAC requests.</td><td><a href="https://static.tagshelf.io/postman/alfred/api-v1-examples-basic.json">https://static.tagshelf.io/postman/alfred/api-v1-examples-basic.json</a></td></tr><tr><td><i class="fa-server" style="color:$primary;">:server:</i> <strong>Webhook receiver sample</strong></td><td>A sample webhook server in Node.js that you can run and adapt.</td><td><a href="https://github.com/tagshelfsrl/alfred-webhook-demo-node">https://github.com/tagshelfsrl/alfred-webhook-demo-node</a></td></tr></tbody></table>

### More documentation

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-clock-rotate-left" style="color:$primary;">:clock-rotate-left:</i> <strong>Release notes</strong></td><td>What changed in each version of Alfred.</td><td><a href="https://docs.tagshelf.dev/release-notes">https://docs.tagshelf.dev/release-notes</a></td></tr><tr><td><i class="fa-book-open" style="color:$primary;">:book-open:</i> <strong>User guide</strong></td><td>The Alfred web app: tags, data points, review and settings.</td><td><a href="https://docs.tagshelf.dev/user-guide-alfred">https://docs.tagshelf.dev/user-guide-alfred</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tagshelf.dev/master.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
