VoidhashDocs
DevelopersHelp centerGuidesAPI reference
Open Studio
Essentials
API overview
Authentication
Event capture
Push device API
Webhooks
Webhook delivery
Webhook events
Projects & keys
Projects
API keys
Audit log
Customers & access
Persons
Products
Perks
Sandbox
Paywalls
Paywalls
Paywall templates
Paywall locations
Components
Component registry
Assets
Experiments & flags
Experiments
Feature flags
Analytics & events
Analytics
Analytics alerts
Analytics annotations
Cohorts
Group types
Groups
Events
Ingest policy
VoidQL
Tracking domains
Ads
Ads
Ad accounts
Meta measurement
Payments & stores
Payment providers
Payment provider products
Purchase history imports
Payment sources
Webhooks & notifications
Webhooks
Push notifications
Push configurations
Automations
Organization & team
Organizations
Members
Invitations
Billing
Your account
Profile
Session
Notices
Connected apps
Terms of Service
Developer tools
Schema
SDK
List assets
Create an asset
Retrieve an asset
Preview an asset
Start an asset upload
Theme
Voidhash

Paywalls, subscriptions and analytics for mobile apps.

Product
PaywallsPurchasesAnalyticsExperimentsBots
Developers
DocumentationSDKsMCP serverCLIAPI reference
Company
PricingSecurityPrivacyContact
© 2026 Voidhash s.r.o.
TermsLegalXDiscord
  1. Assets
  2. Start an asset upload

Start an asset upload

Starts adding a file to the project's library.

The answer describes the request that sends the file straight to storage; send it, then create the asset from the upload. Nothing is added before that. A person, or an app acting as one, can upload; a secret key cannot. Needs project:files:write.

Guide: Fonts and images

Errors

StatustypecodeWhen
400invalid_requestinvalid_fileFor a type or size the library does not take.
403permission_deniedpermission_deniedWithout permission to change the project's files.
409conflictidempotency_key_reusedFor a key already used for another file.
409conflictupload_finishedFor one whose file has been added or refused.
503unavailablefile_storage_unavailable—

It can also fail with the errors every operation shares, such as unauthenticated; see Errors.

More in Assets

  • List assets GET
  • Create an asset POST
  • Retrieve an asset GET
  • Preview an asset GET

Something wrong or missing on this page? Tell us by email or on Discord.

PreviousPreview an assetNextList experiments

On this page

AuthorizationPath parametersHeader parametersRequest bodyExamplesResponse bodyErrorsMore in Assets
POST
/api/v1/projects/{projectId}/assets/uploads

Authorization

AuthorizationBearer <token>

A project secret key: vh_sk_... for production, vh_sk_test_... for test. Keep it on your servers.

In: header

Path parameters

projectId*string

The project's id, proj_.... A secret key works only in the project it belongs to.

Header parameters

idempotency-key?string

Names this upload, up to 128 characters, so sending the request again answers the same upload instead of starting another.

Length1 <= length <= 128

Request body

application/json

TypeScript definitions

Use the request body type in TypeScript.

name*string

The file's name, 1 to 255 characters, which the asset gets.

Length1 <= length <= 255
contentType*string

The file's media type: image/png, image/jpeg, image/webp, image/gif, video/mp4, video/webm, video/quicktime, application/pdf, text/plain or text/csv.

Length1 <= length <= 128
sizeBytes*integer

The file's exact size in bytes, up to 104857600 (100 MB). Storage takes no other.

Range1 <= value <= 9007199254740991

Examples

curl -X POST "https://api.voidhash.com/api/v1/projects/proj_tz4a98xxat96iws9zmbrgj3a/assets/uploads" \  -H "idempotency-key: hero-png-2026-03-14" \  -H "Authorization: Bearer vh_sk_..." \  -H "Content-Type: application/json" \  -d '{    "name": "hero.png",    "contentType": "image/png",    "sizeBytes": 48213  }'
{  "id": "upload_h7d2k9m4x1c6v8b3n5q0w2e7",  "url": "https://uploads.example.com/uploads/upload_h7d2k9m4x1c6v8b3n5q0w2e7?signature=...",  "headers": {    "content-type": "image/png",    "if-none-match": "*"  },  "expiresAt": "2026-03-14T09:41:53.000Z"}
{  "error": {    "type": "invalid_request",    "code": "invalid_file",    "message": "File type or size is not allowed."  }}
{  "error": {    "type": "unauthenticated",    "code": "invalid_api_key",    "message": "This secret key is not valid."  }}
{  "error": {    "type": "permission_denied",    "code": "permission_denied",    "message": "Insufficient permissions."  }}
{  "error": {    "type": "not_found",    "code": "project_not_found",    "message": "There is no project proj_tz4a98xxat96iws9zmbrgj3a, or this credential cannot use it.",    "param": "projectId"  }}

{  "error": {    "type": "conflict",    "code": "idempotency_key_reused",    "message": "This Idempotency-Key was already used to create a task that is not on this board."  }}

{  "error": {    "type": "internal",    "code": "internal_error",    "message": "Something went wrong on our side. Try again, and contact support with the Request-Id header if it keeps failing."  }}
{  "error": {    "type": "unavailable",    "code": "file_storage_unavailable",    "message": "File storage is temporarily unavailable. Try again shortly."  }}

Response body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json