> 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

Turn your documents into structured data with the Alfred API and its Python, Node.js and .NET SDKs.

{% columns %}
{% column width="55%" valign="middle" %}
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.

<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="45%" valign="middle" %}

<figure><img src="https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2FxcjkpJFCiPKM55b1c2UA%2Falfred-docs-hero.webp?alt=media&amp;token=d62def49-b55b-410d-a9a0-0fe3c1b248ca" alt="Alfred lifting a cloche to reveal structured data made from a document"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### Start here

{% columns %}
{% column width="25%" %}
[![A document taking off as a paper plane](https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2FLDEO98opjdEL2svwfIS3%2Fquick-start.webp?alt=media\&token=46e77b84-cde8-4ffd-9743-ad6c6dcad11b)](https://docs.tagshelf.dev/quick-start.md)

[**Quick start**](https://docs.tagshelf.dev/quick-start.md)\
Send your first document and read its extracted data, step by step.
{% endcolumn %}

{% column width="25%" %}
[![A machine turning a document into structured cards](https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2F2s6WzIQZ2TJ4suobvpoB%2Fdocument-processing.webp?alt=media\&token=d84f0974-816f-49ca-b688-688f74eb857d)](https://docs.tagshelf.dev/document-processing.md)

[**Document processing**](https://docs.tagshelf.dev/document-processing.md)\
See how a file becomes a job, gets classified and has its data extracted.
{% endcolumn %}

{% column width="25%" %}
[![A dial tracking a batch of documents to completion](https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2FncorfqAfRhHZUbTK8t4n%2Fjob-activity.webp?alt=media\&token=7bd434c1-b984-4df4-b91d-a220ae52679d)](https://docs.tagshelf.dev/endpoints/job.md)

[**Jobs**](https://docs.tagshelf.dev/endpoints/job.md)\
Follow a job from the moment you send it until its results are ready.
{% endcolumn %}

{% column width="25%" %}
[![A service bell sending out a notification](https://2255375864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mae8GCwLSd9I2djPI-M%2Fuploads%2FGlBgVnkvzlVBHoM4XocX%2Fwebhooks.webp?alt=media\&token=f7d54971-91e7-4ae4-9db6-eaa40bd7e708)](https://docs.tagshelf.dev/event-api.md)

[**Webhooks**](https://docs.tagshelf.dev/event-api.md)\
Let Alfred tell your server the moment a job or a file changes, with the Event API.
{% endcolumn %}
{% endcolumns %}

### What's new

{% columns %}
{% column width="50%" %}
**Reading jobs changed in v1.130.0**\
Getting a job now returns a short summary unless you ask for `view=full`, and listing jobs returns a new page format. If your integration reads a job's files or metadata, [see what to change](https://docs.tagshelf.dev/endpoints/job.md). The current SDKs already work this way.
{% endcolumn %}

{% column width="50%" %}
**A dedicated API host is coming**\
We are introducing `api.tagshelf.com`. Once it is available, we recommend moving your integrations to it: API access over `app.tagshelf.com` will then be deprecated and eventually disabled. We'll announce the timeline well in advance.
{% endcolumn %}
{% endcolumns %}

### Explore the API

Every endpoint page lists its parameters, shows a request example for each SDK and for cURL, and describes the response you get back.

{% columns %}
{% column width="33%" %}
**Get set up**

[SDKs](https://docs.tagshelf.dev/sdks.md)\
Official libraries for Python, Node.js and .NET.

[Authentication](https://docs.tagshelf.dev/authentication.md)\
API keys, OAuth tokens and HMAC signatures.

[API conventions](https://docs.tagshelf.dev/endpoints/api-conventions.md)\
Headers, response format, paging, errors and rate limits.
{% endcolumn %}

{% column width="33%" %}
**Send documents**

[File](https://docs.tagshelf.dev/endpoints/file.md)\
Send documents by URL or by upload, and read their results.

[Deferred Session](https://docs.tagshelf.dev/endpoints/deferred-session.md)\
Upload files one at a time and process them as one job.

[Remote Sources](https://docs.tagshelf.dev/endpoints/file/source.md)\
Let Alfred read files from your own cloud storage.
{% endcolumn %}

{% column width="33%" %}
**Follow processing**

[Job](https://docs.tagshelf.dev/endpoints/job.md)\
List your jobs, follow a job's stage, cancel or restart it.

[Event API](https://docs.tagshelf.dev/event-api.md)\
The webhook events Alfred sends, with the payload of each one.

[Correlation IDs](https://docs.tagshelf.dev/correlation-ids.md)\
Match Alfred's jobs and events to your own records.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column width="33%" %}
**Read results**

[Values](https://docs.tagshelf.dev/endpoints/values.md)\
Read the data Alfred extracted from a file.

[Search](https://docs.tagshelf.dev/endpoints/search.md)\
Find documents by their content and their extracted data.

[Report](https://docs.tagshelf.dev/endpoints/report.md)\
Export the confirmed values of every file with a given tag.
{% endcolumn %}

{% column width="33%" %}
**Configure**

[Tag](https://docs.tagshelf.dev/endpoints/tag.md)\
List, create and update your document types.

[Metadata](https://docs.tagshelf.dev/endpoints/metadata.md)\
The data points each tag extracts, with their keys and types.

[Company](https://docs.tagshelf.dev/endpoints/company.md)\
Your company's settings, including its job metadata templates.
{% endcolumn %}

{% column width="33%" %}
**Account and status**

[Account](https://docs.tagshelf.dev/endpoints/account.md)\
The companies and tags you can use, and your webhook.

[Alfred](https://docs.tagshelf.dev/endpoints/tagshelf.md)\
Check that the API is available and that your credentials work.

[Job Stages](https://docs.tagshelf.dev/endpoints/job/job-stages.md) and [File Status](https://docs.tagshelf.dev/endpoints/file/file-status.md)\
Every stage a job goes through and every status a file can have.
{% endcolumn %}
{% endcolumns %}

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

### Install an SDK

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.

### More resources

{% columns %}
{% column width="25%" %}
[Postman collection](https://static.tagshelf.io/postman/alfred/api-v1-examples-basic.json)\
Example requests, with a script that signs HMAC requests.
{% endcolumn %}

{% column width="25%" %}
[Webhook receiver sample](https://github.com/tagshelfsrl/alfred-webhook-demo-node)\
A sample webhook server in Node.js that you can run and adapt.
{% endcolumn %}

{% column width="25%" %}
[Release notes](https://docs.tagshelf.dev/release-notes)\
What changed in each version of Alfred.
{% endcolumn %}

{% column width="25%" %}
[User guide](https://docs.tagshelf.dev/user-guide-alfred)\
The Alfred web app: tags, data points, review and settings.
{% endcolumn %}
{% endcolumns %}


---

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