Publish Template Version

Publish a new version of a template. When you publish a version:

  1. The current draft template is saved as a new version (e.g., "1.0.0")
  2. API submissions continue to use the latest published version
  3. You can safely make changes to the draft without affecting production API calls
  4. Published versions are read-only and cannot be modified

Using Different Versions

  • By default, API submissions use the latest published version
  • Use version=draft to test changes before publishing
  • Specify a version (e.g., version=1.0.0) to use a specific version
  • Use partial versions (e.g., version=1.0) to use the latest matching version

Version Types

The version number follows semantic versioning (MAJOR.MINOR.PATCH):

  • major - For breaking changes that may affect API integrations
  • minor - For new features that are backwards compatible
  • patch - For bug fixes and small improvements

Parameters

  • version_type (string, required) - The type of version to publish: major, minor, or patch
  • description (string, optional) - A description of the changes in this version

Example Request

curl -X POST 'https://api.docspring.com/api/v1/templates/tpl_1234567890abcdef01/publish_version' \
     -u 'API_TOKEN_ID:API_TOKEN_SECRET' \
     -H 'Content-Type: application/json' \
     -d '{
       "version_type": "minor",
       "description": "Added new fields for contact information"
     }'

Example Response

{
  "status": "success",
  "result": {
    "version": "1.1.0",
    "description": "Added new fields for contact information",
    "published_by_id": "usr_000000000000000001",
    "published_at": "2025-01-22T14:12:22.000Z"
  }
}

Error Response

{
  "status": "error",
  "errors": ["Invalid version type! Must be one of: major, minor, patch"]
}

results matching ""

    No results matching ""