Registrar metadato de un archivo subido
POST
/dms/files
const url = 'https://api.dev.lade.com.mx/dms/files';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"teamId":"550e8400-e29b-41d4-a716-446655440000","entityType":"DRIVER","entityId":"770e8400-e29b-41d4-a716-446655440002","fileId":"gg0e8400-e29b-41d4-a716-446655440011","key":"drivers/770e8400-e29b-41d4-a716-446655440002/licencia.pdf","bucket":"documents","fileName":"licencia.pdf","contentType":"application/pdf","size":245678}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.dev.lade.com.mx/dms/files \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "teamId": "550e8400-e29b-41d4-a716-446655440000", "entityType": "DRIVER", "entityId": "770e8400-e29b-41d4-a716-446655440002", "fileId": "gg0e8400-e29b-41d4-a716-446655440011", "key": "drivers/770e8400-e29b-41d4-a716-446655440002/licencia.pdf", "bucket": "documents", "fileName": "licencia.pdf", "contentType": "application/pdf", "size": 245678 }'Guarda en DynamoDB el metadato de un archivo tras subirlo exitosamente con la URL de /dms/upload-url (nombre, tipo, tamaño, entidad a la que pertenece). Es el paso 2 del flujo de subida: 1) POST /dms/upload-url → subir a S3 → 2) POST /dms/files.
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»Media typeapplication/json
object
teamId
required
string format: uuid
entityType
required
string
entityId
required
string format: uuid
fileId
required
Generado por el cliente
string format: uuid
key
required
S3 key devuelto por /dms/upload-url
string
bucket
string
fileName
required
string
contentType
required
string
size
integer
Example
{ "teamId": "550e8400-e29b-41d4-a716-446655440000", "entityType": "DRIVER", "entityId": "770e8400-e29b-41d4-a716-446655440002", "fileId": "gg0e8400-e29b-41d4-a716-446655440011", "key": "drivers/770e8400-e29b-41d4-a716-446655440002/licencia.pdf", "bucket": "documents", "fileName": "licencia.pdf", "contentType": "application/pdf", "size": 245678}Responses
Sección titulada «Responses»Metadato guardado
Media typeapplication/json
object
file
Metadato de un archivo subido vía DMS (el binario vive en S3, esto es el registro en DynamoDB)
object
fileId
string format: uuid
teamId
string format: uuid
entityType
string
entityId
string format: uuid
key
S3 key
string
bucket
string
fileName
string
contentType
string
size
integer
uploadedBy
string format: uuid
uploadedAt
string format: date-time
url
URL pública (CloudFront) si bucket=assets, o URL prefirmada de 900s si bucket=documents
string
Example
{ "file": { "fileId": "gg0e8400-e29b-41d4-a716-446655440011", "teamId": "550e8400-e29b-41d4-a716-446655440000", "entityType": "DRIVER", "entityId": "770e8400-e29b-41d4-a716-446655440002", "key": "drivers/770e8400-e29b-41d4-a716-446655440002/licencia.pdf", "bucket": "documents", "fileName": "licencia.pdf", "contentType": "application/pdf", "size": 245678, "url": "" }}Solicitud inválida
Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{ "error": "Validation failed", "field": "email", "message": "Invalid email format"}Sin permisos
Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{ "error": "Forbidden", "message": "You don't have permission to access this resource"}