> 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, with our Python, Node.js and .NET SDKs or plain HTTP.

{% columns %}
{% column width="50%" valign="middle" %}
Alfred turns your documents into structured data. Send a file, and Alfred works out what kind of document it is, reads the data points you defined for that type, and hands you the results through this API or as events sent to your server.

New here? The Quick start takes you from an API key to your first extracted values in about 10 minutes, with the SDK for your language or plain HTTP.

<a href="https://docs.tagshelf.dev/quick-start.md" class="button primary">Quick start</a> <a href="https://docs.tagshelf.dev/sdks.md" class="button secondary">SDKs</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, step by step.</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>See 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>Let Alfred tell your server the moment 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>

<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-cubes" style="color:$primary;">:cubes:</i> <strong>SDKs</strong></td><td>Official libraries for Python, Node.js and .NET: install one, connect, and make your first call in minutes.</td><td><a href="https://docs.tagshelf.dev/sdks.md">SDKs</a></td></tr><tr><td><i class="fa-link" style="color:$primary;">:link:</i> <strong>Correlation IDs</strong></td><td>Give each job your own reference, find it again later, and match Alfred's events to your records.</td><td><a href="https://docs.tagshelf.dev/correlation-ids.md">Correlation IDs</a></td></tr></tbody></table>

{% columns %}
{% column width="50%" %}
{% 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. The current SDKs already work this way.
{% endhint %}
{% endcolumn %}

{% column width="50%" %}
{% 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 %}
{% endcolumn %}
{% endcolumns %}

### API reference

Every endpoint, with its parameters, a request example for each SDK and for cURL, and the response you get back.

<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, with or without an SDK.</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. The SDKs send both for you. If you call the API directly, read [API conventions](https://docs.tagshelf.dev/endpoints/api-conventions.md) before your first call.

### SDKs and tools

Prefer a library to raw HTTP? The official SDKs take care of authentication, errors and real-time events, so you can get to your own code sooner.

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

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

[alfred-python on PyPI](https://pypi.org/project/alfred-python/) · [source on GitHub](https://github.com/tagshelfsrl/alfred-python)
{% endtab %}

{% tab title="Node.js SDK" %}

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

[@tagshelf/alfred on npm](https://www.npmjs.com/package/@tagshelf/alfred) · [source on GitHub](https://github.com/tagshelfsrl/alfred-node)
{% endtab %}

{% tab title=".NET SDK" %}

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

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

The examples in these docs use `alfred-python` 0.7.0, `@tagshelf/alfred` 2.0.0 and `TagShelf.Alfred.ApiWrapper` 0.7.0, or later. The [SDKs](https://docs.tagshelf.dev/sdks.md) page shows how to connect, what each SDK covers, and how to receive job and file events in real time without a webhook.

<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.
