Skip to content

Docs

update_media

Change a media asset's alt text (what screen readers say about the image or video; null or an empty string clears it) or its display file name. Alt text set on a post's media reference overrides this one for that post. To write alt text with AI, use generate_alt_text.

Change a media asset's alt text (what screen readers say about the image or video; null or an empty string clears it) or its display file name. Alt text set on a post's media reference overrides this one for that post. To write alt text with AI, use generate_alt_text.

Access and cost

  • Kind: mutation
  • Scope: workspace
  • Actors: member, agent
  • Credits: Free
  • Requires confirmation: false
  • Accepts idempotency key: false

Input schema

{
  "properties": {
    "workspaceId": {
      "format": "uuid",
      "type": "string"
    },
    "mediaAssetId": {
      "format": "uuid",
      "type": "string"
    },
    "altText": {
      "anyOf": [
        {
          "maxLength": 2000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "filename": {
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "workspaceId",
    "mediaAssetId"
  ],
  "type": "object"
}

Output schema

{
  "additionalProperties": false,
  "properties": {
    "mediaAsset": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "workspaceId": {
          "format": "uuid",
          "type": "string"
        },
        "kind": {
          "enum": [
            "image",
            "video"
          ],
          "type": "string"
        },
        "status": {
          "enum": [
            "uploading",
            "processing",
            "ready",
            "failed"
          ],
          "type": "string"
        },
        "storageProvider": {
          "enum": [
            "supabase",
            "r2"
          ],
          "type": "string"
        },
        "storageBucket": {
          "type": "string"
        },
        "storageKey": {
          "type": "string"
        },
        "publicUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "filename": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "sizeBytes": {
          "type": [
            "string",
            "null"
          ]
        },
        "width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "durationMs": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "probe": {
          "type": "object"
        },
        "probeError": {
          "type": [
            "string",
            "null"
          ]
        },
        "covers": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "storageKey": {
                "type": "string"
              },
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              },
              "atMs": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "storageKey",
              "width",
              "height",
              "atMs"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "altText": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdByAccountId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdByAgentClientId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "previewUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "coverFrames": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "atMs": {
                "minimum": 0,
                "type": "integer"
              },
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "atMs",
              "width",
              "height",
              "url"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "fitsPlatforms": {
          "items": {
            "enum": [
              "x",
              "linkedin",
              "threads",
              "bluesky",
              "instagram",
              "facebook",
              "tiktok",
              "youtube",
              "sandbox"
            ],
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "id",
        "workspaceId",
        "kind",
        "status",
        "storageProvider",
        "storageBucket",
        "storageKey",
        "publicUrl",
        "filename",
        "mimeType",
        "sizeBytes",
        "width",
        "height",
        "durationMs",
        "probe",
        "probeError",
        "covers",
        "altText",
        "createdByAccountId",
        "createdByAgentClientId",
        "createdAt",
        "updatedAt",
        "previewUrl",
        "coverFrames",
        "fitsPlatforms"
      ],
      "type": "object"
    }
  },
  "required": [
    "mediaAsset"
  ],
  "type": "object"
}

Errors

[]

Annotations

{
  "destructiveHint": false,
  "idempotentHint": true,
  "openWorldHint": false,
  "readOnlyHint": false,
  "title": "Update media"
}