---
title: "External Document Update With Payload"
method: POST
path: "/v1/webhook/subco-document-upload"
tags: ["Use case / Subcontractor dispatch", "Webhooks / Inbound", "Use case / Document import"]
---

# External Document Update With Payload

`POST /v1/webhook/subco-document-upload`

Upload a document to a specific stop on a subcontracted trip.

This webhook uses **Basic Auth** (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `question_path_key` | Yes | Maps the file to a document type in Qargo (e.g. `CMR`, `POD`, `WEIGHT_NOTE`) |
| `stop_id` | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| `Content-Type` | Yes | MIME type of the file (e.g. `application/pdf`, `image/jpeg`) |
| `Content-Disposition` | No | Provides the filename: `attachment; filename="POD.pdf"` |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If `Content-Disposition` includes a `filename` — that value is used, combined with the question path key default.
   For example: `filename="pod1234.pdf"` with question path key default `POD.pdf` → stored as `pod1234_POD.pdf`.
2. If no `Content-Disposition` is provided — the default filename from the question path key configuration is used.

## Example

```
curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=<stop_uuid>" \
  -u "<webhook_client_id>:<webhook_secret_id>" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf
```

## Query parameters

- `question_path_key` string, required
- `stop_id` string, required

## Request body

- union — A single binary file or JSON message
  - string, binary
  - object
  - unknown[]
    - unknown
  - string
  - integer
  - number
  - boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `400` — Bad Request — invalid input or malformed request
- `401` — Unauthorized — missing or invalid authentication credentials
- `403` — Forbidden — insufficient permissions for this operation
- `422` — Validation Error
- `429` — Too Many Requests — rate limit exceeded. See the `Retry-After` header
- `500` — Internal Server Error
- `503` — Service Unavailable — temporarily unable to handle the request

---

[API](https://skmtc.dev/qargo/apis/qargo-tms-api.md) · [All operations](https://skmtc.dev/qargo/apis/qargo-tms-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qargo/qargo-tms-api/revisions/17297902e7ce/schema)
