Retrieve Assembly statistics
Returns Assembly counts for a requested region and time range.
https://api2.transloadit.com/ assembly_statsThe example includes Assemblies with and without a Template in the requested region and time range.
Omitting template_id selects only Assemblies created without a Template.
Request example
Run this request in a server-side shell with curl and a suitable bearer token in TRANSLOADIT_TOKEN. If you need a token, expand the setup below.
This example also uses jq to encode dynamic values as JSON.
Need a bearer token?
In a trusted server-side shell with curl and jq, set TRANSLOADIT_KEY and TRANSLOADIT_SECRET to your Auth Key and Auth Secret. Keep both credentials and the resulting token secret; never run this setup in browser code.
First, create a token with this endpoint’s required scopes. Your Auth Key must already grant those scopes.
if ! TOKEN_RESPONSE="$(curl --fail-with-body -sS \
--request POST \
--url 'https://api2.transloadit.com/token' \
--user "${TRANSLOADIT_KEY:?Set TRANSLOADIT_KEY}:${TRANSLOADIT_SECRET:?Set TRANSLOADIT_SECRET}" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'aud=api2' \
--data-urlencode 'scope=assemblies:read')"; then
printf '%s\n' "$TOKEN_RESPONSE" >&2
exit 1
fi
TRANSLOADIT_TOKEN="$(printf '%s' "$TOKEN_RESPONSE" |
jq -er '.access_token | strings | select(length > 0)')" || exit 1
Keep this shell open and run the request below. Reuse the token while it remains valid.
SINCE="$(date -u +%Y-%m-%dT00:00:00Z)"
PARAMS="$(jq -cn --arg since "${SINCE:?Set SINCE}" '{"region":"us-east-1","since":$since,"template_id":"all"}')"
curl --fail-with-body -sS --request GET --get \
--url "https://api2.transloadit.com/assembly_stats" \
--header "Authorization: Bearer ${TRANSLOADIT_TOKEN:?Set TRANSLOADIT_TOKEN}" \
--data-urlencode "params=$PARAMS"
Authentication
This endpoint accepts signed params or a bearer token. See Authentication for setup instructions.
Required scope for the Auth Key or bearer token: assemblies:read.
Signed requests require both a signature and a future params.auth.expires timestamp. Bearer tokens do not require either.
Query parameters
params(JSON string), required. A JSON-encoded object whose supported keys are listed below.signature(string). Required for signed requests. Omit this field when using a bearer token.
Supported keys inside the params field
Authentication fields in this list apply to signed requests. With a bearer token, you can omit params.auth and the separate signature field. Compare the authentication-specific request parameters below.
Complete JSON Schema
params: Only the fields listed for this object are accepted.
| Field | Type and description |
|---|---|
params.required for signed requests; optional with a bearer token | Contains the Transloadit API key and signature-authentication metadata for an Assembly Stats request.
|
params.required | stringISO 8601 expiration timestamp in the future. Required when a request is signed or requires signature authentication; bearer-authenticated requests may omit it. |
params.required | stringTransloadit API key used to authenticate requests |
params. | string | integerUnique, random value included in signed request params to make each signature unique and prevent accidental signature reuse. |
params. | string | integerUnique, random value included in signed request params to make each signature unique and prevent accidental signature reuse. |
params.required | string (minimum length: 1)Region to include, or |
params.required | string (minimum length: 1)Date and time at which the statistics window begins, at most 91 days ago. ISO 8601 is recommended; API2 also preserves date strings accepted by its existing parser. A longer lookback is rejected with the endpoint’s invalid-time error. |
params. | null | stringTemplate ID to include, or |
Request parameters by authentication method
With signed params
Include your Auth Key as params.auth.key. When signing the request, include a future params.auth.expires timestamp and send the signature in the separate signature field. The field definitions below use paths inside params.
Complete JSON Schema
params: Only the fields listed for this object are accepted.
Uses the field definitions above: params.auth, params.nonce, params.region, params.since, params.template_id
With a bearer token
Send the bearer token in the Authorization header. You can omit params.auth and the separate signature field. Other required parameters still apply. The field definitions below use paths inside params.
Complete JSON Schema
params: Only the fields listed for this object are accepted.
Uses the field definitions above: params.nonce, params.region, params.since, params.template_id
| Field | Type and description |
|---|---|
params. | Contains the Transloadit API key and signature-authentication metadata for an Assembly Stats request.
|
params. | stringISO 8601 expiration timestamp in the future. Required when a request is signed or requires signature authentication; bearer-authenticated requests may omit it. |
params. | stringTransloadit API key used to authenticate requests |
params. | string | integerUnique, random value included in signed request params to make each signature unique and prevent accidental signature reuse. |
Response
Here’s an example response body:
{
"errorStats": [
{
"data_from_ts": 1789200000,
"error": "FILE_IMPORT_FAILED",
"num_erroneous_assemblies": 1
}
],
"errorStatsGranularity": 60,
"errorStatsTotals": [
{
"error": "FILE_IMPORT_FAILED",
"num_erroneous_assemblies": 1
}
],
"granularity": 60,
"ok": "ASSEMBLY_STATS_FOUND",
"stats": [
{
"avg_execution_duration": 2,
"avg_input_file_sizes": 100000,
"avg_live_queue_duration": 0.5,
"avg_output_file_sizes": 90000,
"avg_processing_speed": 0.4,
"avg_upload_duration": 1,
"avg_upload_speed": 0.8,
"data_from_ts": 1789200000,
"num_assemblies": 10,
"num_bytes": 1000000,
"num_cancelled_assemblies": 0,
"num_erroneous_assemblies": 1,
"num_files": 10,
"num_request_aborted_assemblies": 0,
"num_successful_assemblies": 9,
"total_bytes_usage": 1000000,
"total_execution_duration": 20,
"total_live_queue_duration": 5,
"total_num_output_files": 9,
"total_num_uploaded_bytes": 1000000,
"total_output_file_sizes": 900000,
"total_upload_duration": 10
}
],
"totalAssemblies": 10,
"totalBytesProcessed": 1000000,
"totalBytesUploaded": 1000000,
"totalExecutionDuration": 20,
"totalFilesProcessed": 10,
"totalLiveQueueDuration": 5,
"totalOutputBytesProcessed": 900000,
"totalOutputFilesProcessed": 9,
"totalUploadDuration": 10,
"totalUsage": 1000000
}2xx success
JSON response body. application/json text/plain; charset=utf-8
Response body schema
Complete JSON Schema
The response contains only the fields listed for this object.
| Field | Type and description | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
errorStatsrequired | Array<object>Array item schema
| ||||||||||||||||||||||||||||||||||||||||||||||
errorStatsGranularityrequired | integer (exclusive minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
errorStatsTotalsrequired | Array<object>Array item schema
| ||||||||||||||||||||||||||||||||||||||||||||||
granularityrequired | integer (exclusive minimum: 0)Duration of each statistics bucket in seconds. | ||||||||||||||||||||||||||||||||||||||||||||||
okrequired | string (always: "ASSEMBLY_STATS_FOUND") | ||||||||||||||||||||||||||||||||||||||||||||||
statsrequired | Array<object>Array item schema
| ||||||||||||||||||||||||||||||||||||||||||||||
totalAssembliesrequired | integer (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalBytesProcessedrequired | integer (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalBytesUploadedrequired | integer (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalExecutionDurationrequired | number (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalFilesProcessedrequired | integer (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalLiveQueueDurationrequired | number (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalOutputBytesProcessedrequired | integer (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalOutputFilesProcessedrequired | integer (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalUploadDurationrequired | number (minimum: 0) | ||||||||||||||||||||||||||||||||||||||||||||||
totalUsagerequired | integer (minimum: 0) |
HTTP 400
JSON response body. application/json text/plain; charset=utf-8
Response body schema
Complete JSON Schema
Named errors and the general error format
error: "ASSEMBLY_STATS_INVALID_TIME"
since time is missing or incorrect.
The response may contain additional fields.
error: "ASSEMBLY_STATS_MISSING_REGION"
Must provide a specific region, or "all".
The response may contain additional fields.
General error format
HTTP 500
JSON response body. application/json text/plain; charset=utf-8
Response body schema
Complete JSON Schema
Named errors and the general error format
error: "ASSEMBLY_STATS_ERROR"
Could not load Assembly statistics.
The response may contain additional fields.
General error format
Error response
JSON response body. application/json text/plain; charset=utf-8
Response body schema
Complete JSON Schema
The response may contain additional fields.
| Field | Type and description |
|---|---|
assembly_id | string |
error | string (minimum length: 1) |
http_code | number | string
|
message | stringHuman-readable explanation of the error. Its wording can vary; use the |
reason | null | string | number | boolean | Array<any value> | objectAny of the following schemas may apply: nullnullstringstringnumbernumberbooleanbooleanArray<any value>Array<any value>Array item schemaany valueobjectobjectAdditional property schemaany value |