---
title: "assistant_message.failed"
method: POST
path: "assistant_message.failed"
tags: ["Webhook events"]
---

# assistant_message.failed

`POST assistant_message.failed` (webhook)

Delivered when an assistant message fails.

## Payload

- AssistantMessageWebhookPayload — Body POSTed to a registered webhook endpoint when an assistant message reaches a terminal state. Mirrors the `AssistantMessage` GET response.
  - `event` 'assistant_message.succeeded' | 'assistant_message.failed' | 'assistant_message.cancelled', required — Lifecycle events for assistant messages started via the developer API.
  - `messageId` string, required — Opaque assistant message id (e.g. `vg_mesg_...`).
  - `occurredAt` integer, required — Seconds since epoch (Unix timestamp) when the message reached a terminal state.
  - `message` union, required — A single message in an assistant chat. Discriminated by `role`.
    - AssistantInputMessage — A user-authored message in an assistant chat.
      - `messageId` string, required — Opaque assistant message id (e.g. `vg_mesg_...`).
      - `role` 'user', required — Always `user`.
      - `status` 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled', required — Lifecycle status of an assistant chat message. `pending` and `running` are in-progress; `succeeded`, `failed`, and `cancelled` are terminal.
      - `content` string, required — The user's message text.
      - `attachments` AssistantMessageAttachment[], required — Files attached to this message.
        - `fileId` string, nullable — File id (e.g. `vg_file_...`) when the attachment is a storage file. `null` for attachments that are not resolvable storage files.
        - `displayName` string, required — Human-readable name of the attachment.
      - `createdAt` integer, required — Seconds since epoch (Unix timestamp) when the message was created.
    - AssistantOutputMessage — An assistant-authored message in an assistant chat, including any suggestions or actions it offered.
      - `messageId` string, required — Opaque assistant message id (e.g. `vg_mesg_...`).
      - `role` 'assistant', required — Always `assistant`.
      - `status` 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled', required — Lifecycle status of an assistant chat message. `pending` and `running` are in-progress; `succeeded`, `failed`, and `cancelled` are terminal.
      - `content` string, nullable, required — The assistant's text reply. `null` while `status` is `pending` or `running`; may be empty when the assistant only offered widgets.
      - `attachments` AssistantMessageAttachment[], required — Files attached to this message.
        - `fileId` string, nullable — File id (e.g. `vg_file_...`) when the attachment is a storage file. `null` for attachments that are not resolvable storage files.
        - `displayName` string, required — Human-readable name of the attachment.
      - `workflowSuggestions` AssistantWorkflowSuggestion[], required — Workflow starting points the assistant suggested on this message. Empty when none were offered.
        - `actionId` string, required — Opaque id to pass to the act-on-action endpoint to select this workflow.
        - `workflowType` 'SCRIPT_TO_VIDEO' | 'VOICEOVER_TO_VIDEO' | 'SLIDESHOW_TO_VIDEO' | 'STORYBOARD_TO_VIDEO' | 'PROMPT_TO_VIDEO_CLIP' | 'CREATIVE_BRIEF_TO_VIDEO', required — Workflow type identifier.
        - `title` string, required — Short human-readable name of the suggested workflow.
        - `description` string, required — One-line explanation of what this workflow will do.
      - `actions` AssistantAction[], required — Actionable widgets the assistant offered on this message (plans, edits, tools, generate). Empty when none were offered.
        - `actionId` string, required — Opaque id to pass to the act-on-action endpoint.
        - `kind` 'APPROVE_PLAN' | 'APPLY_EDIT' | 'RUN_TOOL' | 'GENERATE' | 'OPEN_IN_APP', required — Normalized category of an actionable widget the assistant offered. `APPROVE_PLAN` accepts a proposed generation plan; `APPLY_EDIT` applies a proposed edit (e.g. a rewritten script); `RUN_TOOL` runs an inline tool; `GENERATE` starts building the video; `OPEN_IN_APP` requires the full web app — open the assistant's `projectUrl` instead of acting via the API.
        - `label` string, required — Human-readable label describing what acting on this will do.
        - `requiresApp` boolean, required — When true, this action can only be completed in the web app; open the assistant's `projectUrl` instead of calling the API.
        - `detail` AssistantActionDetail — Extra data for rendering this action inline (in a chat surface or integration) without opening the web app. Fields are populated only when relevant to the action's kind; all are optional.
          - `summary` string, nullable — Human-readable summary of the proposed plan or edit (for `APPROVE_PLAN` and `APPLY_EDIT` actions).
          - `creditsRemaining` integer, nullable — Credits currently remaining on your team (for the usage/credits widget). A whole number of credits.
          - `estimatedCredits` integer, nullable — Estimated credit cost of the current workflow (for the cost-estimate widget). A whole number of credits.
      - `generation` StartWorkflowRunResponse, required — Returned when a workflow run is accepted. Poll `GET /v1/workflows/runs/{workflowRunId}` or subscribe to webhooks for completion.
        - `workflowRunId` string, required — Opaque workflow run id (e.g. `vg_work_...`).
        - `projectId` string, required — Id of the project created for this workflow run (e.g. `vg_proj_...`).
        - `projectUrl` string, uri, required — Deep link to open this project in the VideoGen web editor. Not required for an API-only integration: store `projectId` and use the Projects API (export, remix, metadata). Use `projectUrl` when a person should open the project in the app to review or edit it manually. The project is visible only to members of your team and any project collaborators, the same access model as a project created in the dashboard.
        - `remixActionIds` string[], required — Opaque remix action ids (e.g. `vg_rmix_...`), one per `remixActions` entry in request order. Empty when no remix actions were requested. Each runs after the video is built; poll `GET /v1/projects/{projectId}/remix-actions`.
      - `error` ApiError, required — Standard error body returned with every non-2xx response (the `default` response of every operation). The HTTP status code conveys the error class; this body carries the details: - `400` invalid request, `401` missing or invalid API key, `403` not permitted (e.g. plan or add-on required, see `requirement`), `404` not found, `409` conflict, `429` rate limited or out of credits, `5xx` server error. Common `code` values include `invalid_request`, `invalid_api_key`, `not_authorized`, `not_found`, `insufficient_credits`, and `rate_limited`. Always branch on `code` (and `requirement.type` when present) rather than parsing `message`.
        - `message` string, required — Human-readable error description. For display and logging only; do not branch on its exact text.
        - `code` string, nullable — Machine-readable error code in snake_case (e.g. `invalid_api_key`, `insufficient_credits`). `null` when no specific code applies.
        - `requirement` ErrorRequirement — What is needed to resolve an error, when it can be fixed by fulfilling a specific requirement (e.g. purchasing an add-on or upgrading the plan).
          - `type` string, required — Machine-readable requirement type in snake_case (e.g. `purchase_add_on`, `upgrade_plan`).
          - `details` object — Key-value pairs with requirement-specific context (e.g. the add-on id to purchase).
        - `internalErrorCode` string, nullable — Opaque internal error code for debugging. Include this when contacting support. `null` when not applicable.
      - `createdAt` integer, required — Seconds since epoch (Unix timestamp) when the message was created.

## Acknowledgement `200`

Acknowledge receipt

---

[API](https://skmtc.dev/videogen/apis/videogen-api.md) · [All operations](https://skmtc.dev/videogen/apis/videogen-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/videogen/videogen-api/revisions/33dda0455d67/schema)
