Skip to content
Navigation

Publish the draft as a new version (TEST documents use it at once)

Runs the same validation and, if nothing fails, creates an immutable version with the exact images it uses (II-D187, II-D224): TEST documents print with it from now on. LIVE documents keep their version until a person approves and POST /v1/templates/{id}/promote moves them (II-D218); the answer says how. Send the revision you validated: if the draft changed since, nothing is published. If the render service is down, nothing is published and you can retry.

POST
https://api.invox.page/v1/templates/{id}/publish

Authorization

  • bearer
    HTTP
    required

Path parameters

  • id
    string
    required
    format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Header parameters

  • Idempotency-Key
    string
    required

    A unique value per operation. Reuse it when retrying the same operation.

    maxLength: 255
  • X-Organization
    optional
    string

    Required with a person's access token: the organization to act on. Omit it with a service-account key.

    format: uuid

Request body JSON required

  • revision
    integer
    required

    The revision your validation answered. If the draft changed since, nothing is published (template_draft_conflict).

    maximum: 9007199254740991 · minimum: 0

Returns

200

A retry: the version the first request published. Or the draft is exactly the latest published version (same source, manifest and images): that version, with already_published: true; nothing new is created and no event is sent.

JSON
  • object
    string
    required
  • template
    object
    required
    • id
      string
      required
    • object
      string
      required
    • kind
      string
      required

      organization: yours, editable. system: shared by the service, read-only, usable as a base.

    • name
      string
      required
    • status
      active
      or
      archived
      required
    • paper
      required

      Any of the following:

      • string
      • null
    • document_types
      array of
      string
      required
    • draft
      object
      required
      • revision
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
      • updated_at
        string | null
        required
    • published_version
      required

      The latest published version: what TEST documents print with. null: never published.

      Any of the following:

      • integer
      • null
    • production_version
      required

      The promoted version: what LIVE documents print with. null: not promoted yet.

      Any of the following:

      • integer
      • null
    • created_at
      string
      required
    • updated_at
      string
      required
  • version
    object
    required
    • id
      string
      required
    • number
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991
    • sha256
      string
      required
    • published_at
      string
      required
    • assets
      map of
      string
      required

      The images it pinned, by name, with their hash.

  • active_on
    object
    required

    Test documents print with it from now on; live documents keep theirs until it is promoted.

    • test
      boolean
      required
    • live
      boolean
      required
  • warnings
    array of
    object
    required
    • id
      string
      required
    • message
      string
      required
  • what_next
    string
    required
  • already_published
    optional
    boolean

    True when the draft was exactly the latest published version: nothing new was published.

201

The version, and what to do to take it to production.

JSON
  • object
    string
    required
  • template
    object
    required
    • id
      string
      required
    • object
      string
      required
    • kind
      string
      required

      organization: yours, editable. system: shared by the service, read-only, usable as a base.

    • name
      string
      required
    • status
      active
      or
      archived
      required
    • paper
      required

      Any of the following:

      • string
      • null
    • document_types
      array of
      string
      required
    • draft
      object
      required
      • revision
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
      • updated_at
        string | null
        required
    • published_version
      required

      The latest published version: what TEST documents print with. null: never published.

      Any of the following:

      • integer
      • null
    • production_version
      required

      The promoted version: what LIVE documents print with. null: not promoted yet.

      Any of the following:

      • integer
      • null
    • created_at
      string
      required
    • updated_at
      string
      required
  • version
    object
    required
    • id
      string
      required
    • number
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991
    • sha256
      string
      required
    • published_at
      string
      required
    • assets
      map of
      string
      required

      The images it pinned, by name, with their hash.

  • active_on
    object
    required

    Test documents print with it from now on; live documents keep theirs until it is promoted.

    • test
      boolean
      required
    • live
      boolean
      required
  • warnings
    array of
    object
    required
    • id
      string
      required
    • message
      string
      required
  • what_next
    string
    required
  • already_published
    optional
    boolean

    True when the draft was exactly the latest published version: nothing new was published.

400

organization_required: This credential needs to say which organization it acts on · validation_failed: The request is not valid · malformed_request: The request body is not valid JSON · idempotency_key_required: This write needs an Idempotency-Key header
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    organization_required
    or
    validation_failed
    or
    malformed_request
    or
    idempotency_key_required
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

401

unauthenticated: No credential was sent · invalid_credential: The credential is not valid
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    unauthenticated
    or
    invalid_credential
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

403

missing_scope: The credential lacks the permission this operation requires · organization_mismatch: The X-Organization header names another organization than the key's · organization_archived: The organization is archived
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    missing_scope
    or
    organization_mismatch
    or
    organization_archived
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

404

not_found: The resource does not exist in this organization · template_not_found: The template does not exist in this organization
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    not_found
    or
    template_not_found
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

409

template_archived: The template is archived · template_draft_conflict: The draft changed since you read it
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    template_archived
    or
    template_draft_conflict
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

422

idempotency_key_reused: This Idempotency-Key was already used with a different request · template_validation_failed: The template does not pass the validation
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    idempotency_key_reused
    or
    template_validation_failed
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

429

rate_limited: Too many requests
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    rate_limited
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

500

internal_error: The service failed
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    internal_error
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

503

service_unavailable: The service cannot answer right now · render_unavailable: The document could not be rendered right now
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    service_unavailable
    or
    render_unavailable
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

Type to search…

↑↓ navigate↵ selectEsc close