# Extracting data

In this case a client wants to just extract data from a document.

:::warning
**Prerequisites:**

1. Active account at app.digitoo.ai and authentication token ([how to get auth token](/authorization))
2. Created workspace within organization ([see more](/documentation/entities/hierarchy))
3. Queue ID ([how to get Queue ID](/api-reference/workspaces#get-workspace-queues-user-has-access-to) or [Queue ID from user response](/api-reference/user#get-current-signed-in-user))
   :::

### Upload a document

<Stepper>

1.  **Call upload API**

    Import of document is initiated via POST call to `/api/v2/queues/:queueId/upload`

    :::info
    Replace `:queueId` with Queue ID eg. `460c2ced-87e2-4fe3-b8ac-55b4d955382c`
    :::

    ```sh
    curl
    --location 'https://api.digitoo.ai/api/v2/queues/:queueId/upload' \
    --header 'Authorization: Bearer :authToken' \
    --form 'file=@"/Users/Downloads/invoice.pdf"'
    --form 'notify_webhook_url="https://webhook.url"'
    ```

1.  **Add webhook url if needed**

    You are able to specify `notify_webhook_url` as optional parameter. We will use this URL to notify you when document's status is changed. The URL must handle POST request and will have following body:

    ```json
    {
      "document_id": "id",
      "queue_id": "queue_id",
      "status": "ready-to-export"
    }
    ```

1.  **Webhook call**

    After document is upload, you shall receive document ID which can be used to call further methods on the document eg. to GET document annotations by calling `/api/v2/documents/:documentId/annotations-values`

</Stepper>

### Invalid invoice detection

In case when extraction service detects the uploaded document is not a valid invoice (eg. it's an email attachment of other type such as a company logo) – it skips the annotation extraction process and the document is set to `extraction-rejected` status. These documents can then be found under Spam folder in Digitoo App.

If the AI detects a false positive, the document can be send to extraction again using this endpoint: [#api-v2-documents-enqueue-to-extraction](/api-reference/documents#enqueue-document-to-extraction "mention")

In case you do not want this feature, you can disable via API: [#api-v2-queues-use-invalid-invoice-detection](/api-reference/queues#use-invalid-invoice-detection "mention")
