Files
File uploads are asynchronous; poll file status before starting report workflows when needed.
Generated from contracts in
packages/contracts/src/v1. Do not hand-edit this page.
POST /v1/files
Upload media via multipart form-data.
- Request body is multipart form-data with
fileand optionallabelfields.
Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"mediaId": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"contentType": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"sizeBytes": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"durationSeconds": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
}
},
"required": [
"mediaId",
"createdAt",
"contentType"
],
"additionalProperties": false
}
GET /v1/files
List team media files.
Query schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"limit": {
"default": 20,
"type": "integer",
"minimum": 1,
"maximum": 100
},
"cursor": {
"type": "string"
},
"includeDeleted": {
"default": false,
"type": "boolean"
}
},
"required": [
"limit",
"includeDeleted"
],
"additionalProperties": false
}
Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"mediaId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"contentType": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"sizeBytes": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"durationSeconds": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"processingStatus": {
"type": "string",
"enum": [
"PENDING",
"PROCESSING",
"COMPLETED",
"FAILED"
]
},
"lastUsedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
{
"type": "null"
}
]
},
"retention": {
"type": "object",
"properties": {
"expiresAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
{
"type": "null"
}
],
"description": "When the file will expire (null if locked)"
},
"daysRemaining": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Days until expiry (null if locked or deleted)"
},
"locked": {
"type": "boolean",
"description": "Whether the file is locked from automatic deletion"
}
},
"required": [
"expiresAt",
"daysRemaining",
"locked"
],
"additionalProperties": false
}
},
"required": [
"mediaId",
"createdAt",
"contentType",
"processingStatus",
"lastUsedAt",
"retention"
],
"additionalProperties": false
}
},
"nextCursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"hasMore": {
"type": "boolean"
}
},
"required": [
"files",
"nextCursor",
"hasMore"
],
"additionalProperties": false
}
GET /v1/files/:mediaId
Fetch one media file by id.
Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"mediaId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"contentType": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"sizeBytes": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"durationSeconds": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"processingStatus": {
"type": "string",
"enum": [
"PENDING",
"PROCESSING",
"COMPLETED",
"FAILED"
]
},
"lastUsedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
{
"type": "null"
}
]
},
"retention": {
"type": "object",
"properties": {
"expiresAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
{
"type": "null"
}
],
"description": "When the file will expire (null if locked)"
},
"daysRemaining": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Days until expiry (null if locked or deleted)"
},
"locked": {
"type": "boolean",
"description": "Whether the file is locked from automatic deletion"
}
},
"required": [
"expiresAt",
"daysRemaining",
"locked"
],
"additionalProperties": false
}
},
"required": [
"mediaId",
"createdAt",
"contentType",
"processingStatus",
"lastUsedAt",
"retention"
],
"additionalProperties": false
}
PATCH /v1/files/:mediaId/retention
Lock or unlock automatic retention deletion.
Request schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"lock": {
"type": "boolean",
"description": "Set to true to lock, false to unlock"
}
},
"required": [
"lock"
],
"additionalProperties": false
}
Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"mediaId": {
"type": "string"
},
"retentionLock": {
"type": "boolean"
},
"message": {
"type": "string"
}
},
"required": [
"mediaId",
"retentionLock",
"message"
],
"additionalProperties": false
}
DELETE /v1/files/:mediaId
Delete media file metadata and storage.
Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"mediaId": {
"type": "string"
},
"deleted": {
"type": "boolean",
"const": true
}
},
"required": [
"mediaId",
"deleted"
],
"additionalProperties": false
}