Action payload · devices:media
push_media
Import a small file. dataB64 is complete padded base64 (no data URL), at most 2,800,000 characters; malformed or unpadded input returns VALIDATION. MIME is image/jpeg, image/png or video/mp4. Example bytes are a PNG header only: replace with the complete file. Requires an acknowledged-import phone agent and gallery permission; result.status imported acknowledges import, not publication.
Payload
{
"type": "push_media",
"fileName": "image.png",
"mime": "image/png",
"dataB64": "iVBORw0KGgo="
}Payload fields
typestringrequiredDiscriminator that selects the action or content shape.
"push_media"fileNamestringrequiredDestination filename with a matching media extension. Path separators are not allowed.
"image.png"Validation pattern
^[A-Za-z0-9][A-Za-z0-9._ -]*$mimestringrequiredMedia MIME type. It must match the actual source bytes.
"image/jpeg""image/png""video/mp4"dataB64stringrequiredComplete padded base64 bytes without a data URL prefix. Use the complete file or the current ordered chunk.
"iVBORw0KGgo="Validation pattern
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$Unknown fields are rejected.
View JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"push_media"
],
"description": "Discriminator that selects the action or content shape."
},
"fileName": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[A-Za-z0-9][A-Za-z0-9._ -]*$",
"description": "Destination filename with a matching media extension. Path separators are not allowed."
},
"mime": {
"type": "string",
"enum": [
"image/jpeg",
"image/png",
"video/mp4"
],
"description": "Media MIME type. It must match the actual source bytes."
},
"dataB64": {
"type": "string",
"minLength": 4,
"maxLength": 2800000,
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
"description": "Complete padded base64 bytes without a data URL prefix. Use the complete file or the current ordered chunk."
}
},
"required": [
"type",
"fileName",
"mime",
"dataB64"
],
"additionalProperties": false,
"description": "Import a small file. dataB64 is complete padded base64 (no data URL), at most 2,800,000 characters; malformed or unpadded input returns VALIDATION. MIME is image/jpeg, image/png or video/mp4. Example bytes are a PNG header only: replace with the complete file. Requires an acknowledged-import phone agent and gallery permission; result.status imported acknowledges import, not publication.",
"example": {
"type": "push_media",
"fileName": "image.png",
"mime": "image/png",
"dataB64": "iVBORw0KGgo="
}
}REST wraps this payload inside {requestId, command}. The matching MCP tool takes sessionId and requestId plus these fields, without the type discriminator.
Contract
Submit this as command to POST /sessions/{sessionId}/actions, pass it as the CLI action JSON, or use the matching MCP convenience tool. Command objects are strict and reject unknown fields.
Execution
Import a small file. dataB64 is complete padded base64 (no data URL), at most 2,800,000 characters; malformed or unpadded input returns VALIDATION. MIME is image/jpeg, image/png or video/mp4. Example bytes are a PNG header only: replace with the complete file. Requires an acknowledged-import phone agent and gallery permission; result.status imported acknowledges import, not publication.
Action status and driver result remain separate. A completed result can still require a fresh screenshot or hierarchy check to prove the intended visible effect.
Edge cases
- dataB64 must be complete padded base64 without a data URL prefix. The MIME and filename must match the real source bytes.
