POST
/
assets
/
{id}
/
versions
/
{versionId}
/
clone
curl --request POST \
  --url https://api.posta.co/assets/{id}/versions/{versionId}/clone \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "notes": "Initial version.",
  "publish": false
}'
{
  "id": "astv_2jyk1xYhW4n0vVfHirU5eJeXsbw",
  "status": "draft",
  "notes": "Minor changes to the footer.",
  "content": {
    "source": "inline",
    "type": "text/html",
    "content": "<html><body>Hello {{firstName}}</body></html>"
  },
  "variableDefinitions": [
    {
      "name": "name",
      "behavior": "required",
      "allowEmpty": false
    }
  ],
  "contentType": "text/html",
  "contentLength": 100,
  "contentUrl": "https://api.posta.co/assets/astv_2jyk1xYhW4n0vVfHirU5eJeXsbw/content",
  "publish": false,
  "createdAt": "2023-06-07T12:34:56Z",
  "modifiedAt": "2023-06-07T12:34:56Z"
}
  • This creates a new draft version with the same content and variable definitions as the source version.
  • The new version will be associated with the same Asset as the original version.
  • Cloning is useful for making changes to a published or archived version without affecting the original.
  • The cloned version will have a new unique identifier and its status will be set to ‘draft’.

Authorizations

X-Api-Key
string
header
required

Headers

Idempotency-Key
string

Unique idempotency key for each request (e.g., V4 UUID).

Path Parameters

id
string
required

The unique identifier of the asset. Format: 'ast_' followed by alphanumeric characters.

versionId
string
required

The unique identifier of the asset version. Format: 'astv_' followed by alphanumeric string.

Body

application/json

TODO

The body is of type object.

Response

200
application/json

Generic response for a resource request

Represents a specific version of an Asset, containing the actual content and metadata. Asset Versions are the core entities for version control, compliance tracking, and content management in Posta.

Key aspects:

  • Content: Can be HTML templates (with variable support), images, fonts, or documents (e.g., PDFs).
  • Status: Determines the overall status of the parent Asset (draft, published, archived, or deleted).
  • Version Control: Allows tracking changes and maintaining multiple iterations of an Asset.
  • Compliance: Facilitates auditing and regulatory compliance through versioning.

HTML templates can use variables for dynamic content. Images and fonts can be referenced as variables within HTML templates. Documents (like PDFs) are static and used for rendering documents without dynamic components.

POST
/
assets
/
{id}
/
versions
/
{versionId}
/
clone
curl --request POST \
  --url https://api.posta.co/assets/{id}/versions/{versionId}/clone \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "notes": "Initial version.",
  "publish": false
}'
{
  "id": "astv_2jyk1xYhW4n0vVfHirU5eJeXsbw",
  "status": "draft",
  "notes": "Minor changes to the footer.",
  "content": {
    "source": "inline",
    "type": "text/html",
    "content": "<html><body>Hello {{firstName}}</body></html>"
  },
  "variableDefinitions": [
    {
      "name": "name",
      "behavior": "required",
      "allowEmpty": false
    }
  ],
  "contentType": "text/html",
  "contentLength": 100,
  "contentUrl": "https://api.posta.co/assets/astv_2jyk1xYhW4n0vVfHirU5eJeXsbw/content",
  "publish": false,
  "createdAt": "2023-06-07T12:34:56Z",
  "modifiedAt": "2023-06-07T12:34:56Z"
}
  • This creates a new draft version with the same content and variable definitions as the source version.
  • The new version will be associated with the same Asset as the original version.
  • Cloning is useful for making changes to a published or archived version without affecting the original.
  • The cloned version will have a new unique identifier and its status will be set to ‘draft’.

Authorizations

X-Api-Key
string
header
required

Headers

Idempotency-Key
string

Unique idempotency key for each request (e.g., V4 UUID).

Path Parameters

id
string
required

The unique identifier of the asset. Format: 'ast_' followed by alphanumeric characters.

versionId
string
required

The unique identifier of the asset version. Format: 'astv_' followed by alphanumeric string.

Body

application/json

TODO

The body is of type object.

Response

200
application/json

Generic response for a resource request

Represents a specific version of an Asset, containing the actual content and metadata. Asset Versions are the core entities for version control, compliance tracking, and content management in Posta.

Key aspects:

  • Content: Can be HTML templates (with variable support), images, fonts, or documents (e.g., PDFs).
  • Status: Determines the overall status of the parent Asset (draft, published, archived, or deleted).
  • Version Control: Allows tracking changes and maintaining multiple iterations of an Asset.
  • Compliance: Facilitates auditing and regulatory compliance through versioning.

HTML templates can use variables for dynamic content. Images and fonts can be referenced as variables within HTML templates. Documents (like PDFs) are static and used for rendering documents without dynamic components.