Skip to content
PayloadPuffin.
Join the waitlist

Upgrade a managed transform

POST/v1/transforms/{transformId}/upgradepreview

Pin the transform to another version of its managed transform, the newest unless you name one. Every source linking it builds events with that version from then on. Refused with 400 for a version PayloadPuffin doesn’t have, and with 409 when the transform isn’t pinned.

Path parameters

  • transformId string Required

    A transform ID, starting with tfm_.

Body

  • version integer Optional

    The version to pin. Omitted: the newest version.

    At least 1

Returns

200

The command completed.

  • data object Required

    Code that destinations or sources link: one saved draft and the one live code, or a managed pin.

    • id string Required

      A transform ID, starting with tfm_.

    • kind string Required

      destination: maps an event payload to the request a destination receives. source: builds an event from the request a source receives. A transform links only to resources of its kind.

      Allowed values: "destination", "source"

    • name string Required

      A name for people.

      1 to 120 characters

    • managed object | null Required

      The managed transform version this transform runs in place of code of its own.

    • draft object | null Required

      The saved draft. Saving it changes nothing until it is published. Null when pinned.

    • live object | null Required

      The published code every linked destination and source runs. Null until the draft is first published, or when pinned.

    • unpublishedChanges boolean Required

      True when the draft is not the live code: it was never published, or it was saved since.

    • destinations object[] Required

      The destinations that link this transform, by name.

      Show child attributesHide child attributes
      • id string Required

        A destination ID, starting with dst_.

      • name string Required

        Its name.

    • sources object[] Required

      The sources that link this transform, by name.

      Show child attributesHide child attributes
      • id string Required

        A source ID, starting with src_.

      • name string Required

        Its name.

    • createdAt string (date-time) Required

      ISO 8601 timestamp.

    • updatedAt string (date-time) Required

      ISO 8601 timestamp.

Example

Request
curl -X POST "https://api.payloadpuffin.com/v1/transforms/$TRANSFORMID/upgrade" \
  -H "Authorization: Bearer $PAYLOADPUFFIN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{}'
Response 200
{
  "data": {
    "id": "id",
    "kind": "destination",
    "name": "name",
    "managed": {
      "provider": "provider",
      "version": 1
    },
    "draft": {
      "code": "code",
      "savedAt": "savedAt"
    },
    "live": {
      "code": "code",
      "publishedAt": "publishedAt"
    },
    "unpublishedChanges": true,
    "destinations": [
      {
        "id": "id",
        "name": "name"
      }
    ],
    "sources": [
      {
        "id": "id",
        "name": "name"
      }
    ],
    "createdAt": "createdAt",
    "updatedAt": "updatedAt"
  }
}

Errors

Errors use application/problem+json. The code member is stable; branch on it rather than on title or detail.

  • 4XX application/problem+json

    The request was rejected.