Skip to main content
POST
Upload Document
This endpoint works on any account you own. Create Virtual Account Group covers who can open a group and what the account needs first. The onboarding opened by Create Virtual Account Group asks for evidence one requirement at a time. Get Virtual Account Group lists those outstanding requirements, each with a key and the document types it accepts; this endpoint uploads a file against exactly one of them, using requirement_key to say which. A requirement_key that is not currently open on this group is rejected. The file is carried inside the JSON body as a base64 data URI, so there is no multipart upload. Hop stores it as account evidence, links it to the requirement, and sends it to the provider in the same request. A successful response always reports submission_status as submitted. Accept every agreement via Submit Agreement Actions and clear every document requirement to enable the group, then create virtual accounts under it. Requires an API key with write access on the virtual_accounts scope.

Path Parameters

string
required
The account’s external ID (starts with acct_)
string
required
The virtual account group’s external ID (starts with vag_). It must belong to the account in the path.

Headers

string
required
Canonical lowercase 8-4-4-4-12 UUID. Scoped to the group, with the payload fingerprinted including the file’s bytes: replaying the same key with the same payload returns the stored document with 200, and with a different payload returns 409. See Idempotency.

Request Body

Unknown fields are rejected.
string
required
The key of the open document requirement this evidence satisfies, copied from Get Virtual Account Group (1-200 characters). A Hop-normalised key, never a provider code.
string
required
Document type for this upload. Do not treat the document types below as a checklist. Required documents are returned in requirements by the Get Virtual Account Group endpoint. For each requirement where type is document, copy its key to requirement_key and choose one of its accepted_document_types. Types listed for the same requirement are alternatives or substitutes, not all are required. If multiple document requirements are returned, each must be satisfied separately. The list below shows all document types supported by the endpoint.Identity: passport, national_id, drivers_license, residence_permit, selfie.Company: certificate_of_incorporation, articles_of_association, memorandum_of_association, constitution, by_laws, operating_agreement, regulatory_license, certificate_of_good_standing, register_of_directors, register_of_shareholders, organization_chart, corporate_structure.Other evidence: proof_of_address, bank_statement, board_resolution, source_of_funds, source_of_wealth, aml_policy, proof_of_directorship, other.
string
required
The file as a base64 data URI: data:<content-type>;base64,<base64 payload>, with a valid, non-empty base64 payload. The content type inside the URI must be application/pdf, image/jpeg or image/png.
string
front or back. Required for a two-sided identity document, national_id, drivers_license and residence_permit, and rejected for every other type. Upload each side as its own request.
string
Original file name to store with the evidence (1-255 characters), or omit it
string
Country the evidence was issued in, as an ISO 3166-1 alpha-2 code, for example GB
This route accepts a request body of up to 21 MB (22,020,096 bytes), instead of the 1 MB that applies everywhere else on this API. Base64 encoding adds about a third, so the practical ceiling is a file of roughly 15 MB. An oversized body is rejected with 413 REQUEST_TOO_LARGE and details.max_bytes carries the limit.

Response

Returns 201 with the stored document on first upload, or 200 with the same document when the Idempotency-Key was already used with the same payload.
string
Document identifier (starts with doc_). Evidence is stored at account level, so the same document id can appear under more than one group.
string
Always returns "virtual_account_group_document"
string
Account the evidence belongs to (starts with acct_)
string
Virtual account group the evidence was linked to (starts with vag_)
string
The requirement this evidence satisfies, echoing the request
string
Document type, echoing the request
string
front or back for a two-sided identity document, otherwise null
string
Stored file name, or null when none was sent
string
Media type taken from the data URI: application/pdf, image/jpeg or image/png
integer
Size of the decoded file in bytes
string
Delivery state towards the provider. Always submitted on a successful response, since delivery happens before the response is returned. The other values, pending, failed and unknown, are visible in List Documents.
string
ISO 3166-1 alpha-2 country of issue, or null
string
ISO 8601 timestamp when created
string
ISO 8601 timestamp when last updated
string
ID of the API key that uploaded the document (starts with ak_)
string
Actor that last updated the document, or null

When delivery to the provider fails

The file is stored and linked before it is sent on. If the provider then rejects the delivery, the request fails with 502 and no document is returned, but the evidence is kept and its link is marked failed. Retry with the same Idempotency-Key and the same payload: Hop finds the stored evidence and re-attempts delivery instead of creating a second document. A fresh key on the same file uploads it again.

Errors

Request Example

Response Example