Documents

Request presigned upload targets (DEFAULT ingestion path)

Returns presigned S3 POST targets. Upload each file directly to S3, then call the finalize endpoint.

post/v1/clients/{client_id}/documents/prepare

Request

  • Base URL
    https://api.magnetictax.com
  • URL
    https://api.magnetictax.com/v1/clients/{client_id}/documents/prepare
  • Auth
    HTTP bearer

Headers

Idempotency-Keystring

Optional. Retry a write with the same key and you get the ORIGINAL response back instead of the work happening twice — so a request that timed out is safe to repeat. Use one key per logical operation (a UUID), and reuse it for every retry of that operation. Keys are scoped to your API key and honoured for 24 hours. A replayed response carries the Idempotent-Replayed: true header — the body is byte-identical to the original, so that is the only way to tell stored work from fresh work. Reusing a key with a different request body returns 409 idempotency_key_reuse; replaying while the first request is still running returns 409 idempotency_request_in_progress. An empty header, or one over 255 characters, is rejected with 400 invalid_idempotency_key — omit it entirely to opt out.

Request body

Response

OK

failed_document_idsinteger[]

Ids of documents that failed after their row was created. Preferred over failed_document_indices. Empty when a failure occurred before any row/id existed (a total insert failure) — those appear only in failed_document_indices.

failed_document_indicesinteger[]

DEPRECATED (removed in 1.1.0) — prefer failed_document_ids. Positions into the request array; retained because a failure with no created row has no id.

Example response

{
  "upload_targets": [
    {
      "document_id": 7
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.