POST
/
assets
/
{id}
/
versions

The new version will be in ‘draft’ status by default.

Authorizations

X-Api-Key
string
headerrequired

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 to create a new version for. Format: 'ast_' followed by alphanumeric characters.

Body

application/json

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.

notes
string

Optional notes or comments about this specific Asset Version. Useful for tracking changes or providing context.

Maximum length: 255
content
object

Defines the content of an Asset Version, supporting multiple content sources. The source property determines how the content is provided and managed.

  • inline: Content is stored directly in Posta. It can be provided upon creation or added/edited later, used primarily for HTML templates. Maximum 102,400 bytes.

  • import: A convenience feature for initial content creation. Accepts a publicly available URL, downloads the content, and stores it in Posta. After import, it doesn't retain its external reference.

  • externalUrl: Content remains externally hosted and is fetched every time it's needed. Posta does not store this content but maintains a reference to the external URL.

Choose the appropriate type based on your content management needs, update frequency, and integration requirements. inline and import are recommended over externalUrl for security, compliance, and performance reasons.

variableDefinitions
object[]

List of variables defined for this Asset Version. Used for content personalization in HTML templates. Note: When using Assets with Variables with our Letter API, always review the variableHandling option on the Letter. If validationScope is set to none in the request, the defined variables and their behavior will not be evaluated at all. See further information on the Letter object.

publish
boolean

If set to true, this Asset Version will be published immediately after creation. Default is false.

Response

201 - application/json

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.

id
string
required

Unique identifier for the Asset Version. Format: 'astv_' followed by alphanumeric characters.

Required string length: 1 - 99999
status
enum<string>
required

Represents the status of an Asset Version.

  • draft: An Asset Version that is being worked on and can be modified. This is the initial state for new Asset Version and cloned Asset Versions.

  • published: An Asset Version that is finalized and available for use. Published Asset Versions cannot be edited.

  • archived: An Asset Version unavailable for new uses but may still be accessible for historical purposes. It can be republished if needed.

  • deleted: An Asset Version that has been deleted from the system. This is a terminal state.

State transitions:

  • Draft Asset Versions can be published, archived, or deleted.
  • Published Asset Versions can only be archived or deleted.
  • Archived Asset Versions can be republished (becoming published) or deleted.
  • Deleted is a terminal state with no further transitions.

Notes:

  • Only one Asset Version can be in the published state at a time for a given Asset.
  • Publishing a new Asset Versions will automatically archive the previously published one, if there was one.
  • Cloning any non-deleted Asset Versions will create a new one in draft state.
  • Deletion is permanent and should be used with caution.
Available options:
draft,
published,
archived,
deleted
contentType
string
required

MIME type of the Asset Version content. Indicates the format of the content (e.g., 'text/html', 'image/jpeg', 'application/pdf').

Required string length: 1 - 99999
contentLength
integer
required

Length of the Asset Version content in bytes. Useful for content management and transfer considerations.

Required range: -1 < x < 999999999
contentUrl
string
required

URL where the rendered content of this asset version can be accessed. Available after publishing.

Required string length: 1 - 99999
createdAt
string
required

The timestamp the resource was created at (UTC).

modifiedAt
string
required

The timestamp the resource was last modified at (UTC).

notes
string

Optional notes or comments about this specific Asset Version. Useful for tracking changes or providing context.

Maximum length: 255
variableDefinitions
object[]

List of variables defined for this Asset Version. Used for content personalization in HTML templates. Note: When using Assets with Variables with our Letter API, always review the variableHandling option on the Letter. If validationScope is set to none in the request, the defined variables and their behavior will not be evaluated at all. See further information on the Letter object.