Build your preview

Import and export JSON

Back up or reuse an embed layout with the editor's supported component JSON format.

Select JSON in the editor toolbar to open Component JSON. The dialog contains the current draft's component payload. You can edit and apply it, or download it to reuse later.

Export a layout

Select Export JSON to download discord-component-embed.json. The dialog validates its current contents before exporting. If you've edited the JSON in the dialog, the downloaded file contains that validated version.

Exports contain only the top-level component object. They don't include the embed name, destination website, permanent link, or editor history. People with view access can inspect and export JSON without manage access.

Apply a layout

Applying JSON replaces every component in your current draft. To reuse an exported layout:

  1. Open the target embed's editor and select JSON.
  2. Replace the dialog's contents with your saved component JSON.
  3. Select Apply JSON. Resolve any validation errors shown in the dialog.
  4. Review the updated preview and any media links.
  5. Select Create for a new embed or Save for an existing embed.

The embed name and destination website stay as they were before the import. You can Undo the import before publishing. Closing the dialog without applying leaves your draft unchanged. Apply JSON requires manage access.

Use the supported format

The payload contains one container, with supported components inside it. This minimal example creates a text-only preview:

{
  "component": {
    "type": 17,
    "accent_color": 40447,
    "components": [
      {
        "type": 10,
        "content": "## Community flight\nBoarding opens at 18:00 UTC."
      }
    ]
  }
}

The JSON dialog uses the same component schema and size limits as publishing. It rejects unknown properties and unsupported component types. Image checks also run when you publish through the editor.

TypeComponentRequired structure
17Containercomponents: 1–39 supported child components. Optional accent_color is an integer from 0 to 16777215, or null; optional spoiler is a boolean.
10TextNonempty content string.
9Sectioncomponents: 1–3 text components; accessory: one thumbnail or link button.
11Thumbnailmedia: { "url": "https://…" }; valid only as a section accessory.
12Galleryitems: 1–10 media objects, each with media: { "url": "https://…" }.
14SeparatorOptional boolean divider; optional spacing is 1 for small or 2 for large.
1Button rowcomponents: 1–5 link buttons.
2Link buttonstyle: 5, a url, and at least one of label or emoji. Valid in a button row or as a section accessory.

Thumbnails and gallery items support optional description and spoiler properties. Descriptions can be up to 1,024 characters or null. Buttons support optional disabled and emoji properties. An emoji object needs an id or name; id is a numeric string, name is 1–100 characters, and optional animated is a boolean.

Components can include an optional integer id from 0 to 4294967295. Nonzero IDs must be unique throughout the payload. You can omit IDs when authoring a layout. Gallery items aren't components and don't have IDs.

Don't paste a whole Discord message, an embeds array, or a webhook request body into this dialog. Its supported root format is { "component": ... }.

Next steps

Check payload limits before building a large layout, then share the result.

Last updated on