Skip to navigation

Post Active Storage Direct Uploads

View as Markdown

Starts a file upload. Returns a blob with a one-time upload URL; upload the bytes there, then use the blob’s signed_id wherever an endpoint takes a file (documents, attachments). Files are limited to 1 GB.

Authentication

AuthorizationBearer

OAuth 2.0 Client Credentials Flow. To obtain an access token:

  1. Request API credentials from HINDSITE support to receive your client_id and client_secret

  2. Make a POST request to obtain an access token:

POST https://app.hindsiteind.com/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET
  1. The response will contain your access token:
{
  "access_token": "your_access_token_here",
  "token_type": "Bearer",
  "expires_in": 7200,
  "created_at": 1234567890
}
  1. Include the token in subsequent API requests:
Authorization: Bearer your_access_token_here

Request

This endpoint expects an object.
blobobjectRequired

Response

Blob created. PUT the file bytes to direct_upload.url with direct_upload.headers, then pass signed_id to the endpoint that attaches the file.

blob_urlstringOptional
signed_idstringOptional
filenamestringOptional
byte_sizeintegerOptional
content_typestringOptional
preview_urlstringOptional

Poster image URL. Present only for previewable blobs (e.g. video).

keystringOptional

Storage key of the file in Hindsite’s file store. Opaque; download the file with blob_url.

direct_uploadobjectOptional

Only present on the POST /api/v2/active_storage/presign and POST /api/v2/active_storage/direct_uploads responses, which omit preview_url. PUT the file bytes to url with headers, then reference the blob by signed_id.

Errors

422
Unprocessable Entity Error