Snippets

Update a snippet.

patch/snippets/{id}

Request

  • Base URL
    https://api.buttondown.com/v1
  • URL
    https://api.buttondown.com/v1/snippets/{id}
  • Auth
    API key in header Authorization

Path parameters

idstring required

Request body

identifierstring nullable

A unique, newsletter-scoped slug used to reference the snippet inside email content (e.g. {{ snippets.footer }}). Must be unique per newsletter.

namestring nullable

A human-readable name for the snippet, shown in the Buttondown UI.

contentstring nullable

The body of the snippet, substituted wherever the snippet is referenced. Interpreted according to mode.

mode'fancy' | 'naked' | 'plaintext'

An enumeration.

Example request

{
  "identifier": "footer",
  "name": "Footer",
  "content": "Thanks for reading!"
}

Response

OK

idstring required

A unique TypeID associated with the object.

creation_datestring date-time required

The date and time at which the object was first created.

identifierstring required

A unique, newsletter-scoped slug used to reference the snippet inside email content (e.g. {{ snippets.footer }}). Must be unique per newsletter.

namestring required

A human-readable name for the snippet, shown in the Buttondown UI.

contentstring required

The body of the snippet, substituted wherever the snippet is referenced. Interpreted according to mode.

mode'fancy' | 'naked' | 'plaintext' required

An enumeration.

reference_countinteger

The number of emails that currently reference this snippet.

Changes

    • breaking

      the / request property's minLength was increased from 0 to 1

    • breaking

      the / request property's minLength was increased from 0 to 1

    • breaking

      added the pattern ^[a-zA-Z0-9_-]+$ to the request property /

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      endpoint added